unison-parser-typechecker-0.0.0
Safe HaskellSafe-Inferred
LanguageHaskell2010

Unison.PrettyPrintEnv

Synopsis

Documentation

data PrettyPrintEnv Source #

Instances

Instances details
Generic PrettyPrintEnv Source # 
Instance details

Defined in Unison.PrettyPrintEnv

Associated Types

type Rep PrettyPrintEnv :: Type -> Type #

Show PrettyPrintEnv Source # 
Instance details

Defined in Unison.PrettyPrintEnv

type Rep PrettyPrintEnv Source # 
Instance details

Defined in Unison.PrettyPrintEnv

type Rep PrettyPrintEnv = D1 ('MetaData "PrettyPrintEnv" "Unison.PrettyPrintEnv" "unison-parser-typechecker-0.0.0-KNkVGbTXlis2lnVjsRIJUx" 'False) (C1 ('MetaCons "PrettyPrintEnv" 'PrefixI 'True) (S1 ('MetaSel ('Just "termNames") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (Referent -> [(HashQualified Name, HashQualified Name)])) :*: S1 ('MetaSel ('Just "typeNames") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (Reference -> [(HashQualified Name, HashQualified Name)]))))

biasTo :: [Name] -> PrettyPrintEnv -> PrettyPrintEnv Source #

Prefer names which share a common prefix with any provided target.

Results are sorted according to the longest common prefix found against ANY target.

labeledRefName :: PrettyPrintEnv -> LabeledDependency -> HashQualified Name Source #

Get a name for a LabeledDependency from the PPE.

Exported only for cases where the codebase's configured hash length is unavailable.

addFallback :: PrettyPrintEnv -> PrettyPrintEnv -> PrettyPrintEnv Source #

Attempts to find a name in primary ppe, falls back to backup ppe only if no names are found. Typically one can use this to shadow global or absolute names with names that are within the current path.

union :: PrettyPrintEnv -> PrettyPrintEnv -> PrettyPrintEnv Source #

Finds names from both PPEs, if left unbiased the name from the left ppe is preferred.

This is distinct from addFallback with respect to biasing; A bias applied to a union might select a name in the right half of the union. Whereas, a bias applied to the result of addFallback will bias within the available names inside the left PPE and will only search in the fallback if there aren't ANY names in the primary ppe.

If you don't know the difference, it's likely you want addFallback where you add global names as a fallback for local names.