unison-core1-0.0.0
Safe HaskellSafe-Inferred
LanguageHaskell2010

Unison.HashQualifiedPrime

Synopsis

Documentation

data HashQualified n Source #

Like Unison.HashQualified, but doesn't support a HashOnly variant

Constructors

NameOnly n 
HashQualified n ShortHash 

Instances

Instances details
Foldable HashQualified Source # 
Instance details

Defined in Unison.HashQualifiedPrime

Methods

fold :: Monoid m => HashQualified m -> m #

foldMap :: Monoid m => (a -> m) -> HashQualified a -> m #

foldMap' :: Monoid m => (a -> m) -> HashQualified a -> m #

foldr :: (a -> b -> b) -> b -> HashQualified a -> b #

foldr' :: (a -> b -> b) -> b -> HashQualified a -> b #

foldl :: (b -> a -> b) -> b -> HashQualified a -> b #

foldl' :: (b -> a -> b) -> b -> HashQualified a -> b #

foldr1 :: (a -> a -> a) -> HashQualified a -> a #

foldl1 :: (a -> a -> a) -> HashQualified a -> a #

toList :: HashQualified a -> [a] #

null :: HashQualified a -> Bool #

length :: HashQualified a -> Int #

elem :: Eq a => a -> HashQualified a -> Bool #

maximum :: Ord a => HashQualified a -> a #

minimum :: Ord a => HashQualified a -> a #

sum :: Num a => HashQualified a -> a #

product :: Num a => HashQualified a -> a #

Traversable HashQualified Source # 
Instance details

Defined in Unison.HashQualifiedPrime

Methods

traverse :: Applicative f => (a -> f b) -> HashQualified a -> f (HashQualified b) #

sequenceA :: Applicative f => HashQualified (f a) -> f (HashQualified a) #

mapM :: Monad m => (a -> m b) -> HashQualified a -> m (HashQualified b) #

sequence :: Monad m => HashQualified (m a) -> m (HashQualified a) #

Functor HashQualified Source # 
Instance details

Defined in Unison.HashQualifiedPrime

Methods

fmap :: (a -> b) -> HashQualified a -> HashQualified b #

(<$) :: a -> HashQualified b -> HashQualified a #

Generic (HashQualified n) Source # 
Instance details

Defined in Unison.HashQualifiedPrime

Associated Types

type Rep (HashQualified n) :: Type -> Type #

Show n => Show (HashQualified n) Source # 
Instance details

Defined in Unison.HashQualifiedPrime

Eq n => Eq (HashQualified n) Source # 
Instance details

Defined in Unison.HashQualifiedPrime

Ord n => Ord (HashQualified n) Source # 
Instance details

Defined in Unison.HashQualifiedPrime

Alphabetical n => Alphabetical (HashQualified n) Source # 
Instance details

Defined in Unison.HashQualifiedPrime

type Rep (HashQualified n) Source # 
Instance details

Defined in Unison.HashQualifiedPrime

type Rep (HashQualified n) = D1 ('MetaData "HashQualified" "Unison.HashQualifiedPrime" "unison-core1-0.0.0-81K0NP5FQX63ztzOFtUCNN" 'False) (C1 ('MetaCons "NameOnly" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 n)) :+: C1 ('MetaCons "HashQualified" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 n) :*: S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 ShortHash)))

fromHQ :: HashQualified n -> HashOrHQ n Source #

If the HashQualified is just a ShortHash, return it on the Left, otherwise return a HashQualified on the Right.

searchBySuffix :: forall ref. Ord ref => (ref -> ShortHash) -> HashQualified Name -> Relation Name ref -> Set ref Source #

Like searchBySuffix, but uses a hash-qualified name to search instead.

The name *and* the hash are used to determine whether something is an exact match. For example, in namespace {foo#foo, hello.foo#bar}, searching for foo#bar will return the singleton set {hello.foo#bar}, because even though there is an exact name match on foo, its hash doesn't match so we fall back to "suffix" matches. This probably isn't a very important detail in practice, but the other possible implementation (do name-only search, *then* filter result down to matching hashes) seems worse.

filterBySuffix :: forall ref. Ord ref => (ref -> ShortHash) -> HashQualified Name -> Relation Name ref -> Relation Name ref Source #

Like searchBySuffix, but also keeps the names around.

searchUnconflictedBySuffix :: forall ref. Ord ref => (ref -> ShortHash) -> HashQualified Name -> BiMultimap ref Name -> Set ref Source #