unison-parser-typechecker-0.0.0
Safe HaskellNone
LanguageHaskell2010

Unison.PrettyPrintEnv.Names

Synopsis

Namer

data Namer Source #

A "namer" associates a set of (possibly hash-qualified) names with a referent / type reference.

alwaysHqNamer :: Int -> Names -> Namer Source #

Make a "namer" that hash-qualifies every name, conflicted or not. This suits names that may no longer mean what they say: for instance, a name in the codebase that a Unison file shadows.

hqNamer :: Int -> Names -> Namer Source #

Make a "namer" out of a collection of names, respecting conflicted names. That is, if references #foo and #bar are both associated with name "baz", then the returned namer maps #foo too "baz"#foo and #bar to "baz"#bar, but otherwise if a reference #qux has a single name "qux", then the returned namer maps #qux to "qux" (not "qux"#qux).

namer :: Names -> Namer Source #

Make a "namer" out of a collection of names, ignoring conflicted names. That is, if references #foo and #bar are both associated with name "baz", then the returned namer maps #foo too "baz" (not "baz"#foo) and #bar to "baz" (not "baz"#bar).

Suffixifier

Pretty-print env

hashQualifyShadowed :: Int -> Names -> PrettyPrintEnv -> PrettyPrintEnv Source #

Hash-qualify the names in a pretty-print env that the given names shadow, unless the reference has another name that isn't shadowed. This is a cheap alternative to rebuilding a large pretty-print env with shadowing.