| Safe Haskell | Safe-Inferred |
|---|---|
| Language | Haskell2010 |
Unison.HashQualifiedPrime
Synopsis
- data HashQualified n
- = NameOnly n
- | HashQualified n ShortHash
- type HQSegment = HashQualified NameSegment
- toHQ :: HashQualified n -> HashQualified n
- type HashOrHQ n = Either ShortHash (HashQualified n)
- fromHQ :: HashQualified n -> HashOrHQ n
- toName :: HashQualified n -> n
- nameLength :: (Name -> Text) -> HashQualified Name -> Int
- take :: Int -> HashQualified n -> HashQualified n
- toHash :: HashQualified n -> Maybe ShortHash
- toTextWith :: (n -> Text) -> HashQualified n -> Text
- fromNamedReferent :: n -> Referent -> HashQualified n
- fromNamedReference :: n -> Reference -> HashQualified n
- fromName :: n -> HashQualified n
- matchesNamedReferent :: Eq n => n -> Referent -> HashQualified n -> Bool
- matchesNamedReference :: Eq n => n -> Reference -> HashQualified n -> Bool
- requalify :: HashQualified Name -> Referent -> HashQualified Name
- searchBySuffix :: forall ref. Ord ref => (ref -> ShortHash) -> HashQualified Name -> Relation Name ref -> Set ref
- filterBySuffix :: forall ref. Ord ref => (ref -> ShortHash) -> HashQualified Name -> Relation Name ref -> Relation Name ref
- searchUnconflictedBySuffix :: forall ref. Ord ref => (ref -> ShortHash) -> HashQualified Name -> BiMultimap ref Name -> Set ref
- filterUnconflictedBySuffix :: forall ref. Ord ref => (ref -> ShortHash) -> HashQualified Name -> BiMultimap ref Name -> BiMultimap ref Name
Documentation
data HashQualified n Source #
Like Unison.HashQualified, but doesn't support a HashOnly variant
Constructors
| NameOnly n | |
| HashQualified n ShortHash |
Instances
type HQSegment = HashQualified NameSegment Source #
toHQ :: HashQualified n -> HashQualified n Source #
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.
toName :: HashQualified n -> n Source #
nameLength :: (Name -> Text) -> HashQualified Name -> Int Source #
take :: Int -> HashQualified n -> HashQualified n Source #
toTextWith :: (n -> Text) -> HashQualified n -> Text Source #
fromNamedReferent :: n -> Referent -> HashQualified n Source #
fromNamedReference :: n -> Reference -> HashQualified n Source #
fromName :: n -> HashQualified n Source #
matchesNamedReferent :: Eq n => n -> Referent -> HashQualified n -> Bool Source #
matchesNamedReference :: Eq n => n -> Reference -> HashQualified n -> Bool Source #
requalify :: HashQualified Name -> Referent -> HashQualified Name Source #
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 #
filterUnconflictedBySuffix :: forall ref. Ord ref => (ref -> ShortHash) -> HashQualified Name -> BiMultimap ref Name -> BiMultimap ref Name Source #