Safe Haskell | Safe-Inferred |
---|---|
Language | Haskell2010 |
Synopsis
- data PrettyPrintEnv = PrettyPrintEnv {
- termNames :: Referent -> [(HashQualified Name, HashQualified Name)]
- typeNames :: Reference -> [(HashQualified Name, HashQualified Name)]
- patterns :: PrettyPrintEnv -> ConstructorReference -> Maybe (HashQualified Name)
- patternName :: PrettyPrintEnv -> ConstructorReference -> HashQualified Name
- terms :: PrettyPrintEnv -> Referent -> Maybe (HashQualified Name)
- types :: PrettyPrintEnv -> Reference -> Maybe (HashQualified Name)
- allTermNames :: PrettyPrintEnv -> Referent -> [HashQualified Name]
- allTypeNames :: PrettyPrintEnv -> Reference -> [HashQualified Name]
- termName :: PrettyPrintEnv -> Referent -> HashQualified Name
- typeName :: PrettyPrintEnv -> Reference -> HashQualified Name
- termNameOrHashOnly :: PrettyPrintEnv -> Referent -> HashQualified Name
- typeNameOrHashOnly :: PrettyPrintEnv -> Reference -> HashQualified Name
- termNameOrHashOnlyFq :: PrettyPrintEnv -> Referent -> HashQualified Name
- typeNameOrHashOnlyFq :: PrettyPrintEnv -> Reference -> HashQualified Name
- biasTo :: [Name] -> PrettyPrintEnv -> PrettyPrintEnv
- labeledRefName :: PrettyPrintEnv -> LabeledDependency -> HashQualified Name
- todoHashLength :: Int
- addFallback :: PrettyPrintEnv -> PrettyPrintEnv -> PrettyPrintEnv
- union :: PrettyPrintEnv -> PrettyPrintEnv -> PrettyPrintEnv
- empty :: PrettyPrintEnv
Documentation
data PrettyPrintEnv Source #
PrettyPrintEnv | |
|
Instances
Generic PrettyPrintEnv Source # | |
Defined in Unison.PrettyPrintEnv type Rep PrettyPrintEnv :: Type -> Type # from :: PrettyPrintEnv -> Rep PrettyPrintEnv x # to :: Rep PrettyPrintEnv x -> PrettyPrintEnv # | |
Show PrettyPrintEnv Source # | |
Defined in Unison.PrettyPrintEnv showsPrec :: Int -> PrettyPrintEnv -> ShowS # show :: PrettyPrintEnv -> String # showList :: [PrettyPrintEnv] -> ShowS # | |
type Rep PrettyPrintEnv Source # | |
Defined in Unison.PrettyPrintEnv type Rep PrettyPrintEnv = D1 ('MetaData "PrettyPrintEnv" "Unison.PrettyPrintEnv" "unison-parser-typechecker-0.0.0-JliU30UQmMa2dDW5SxUdL" '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)])))) |
patterns :: PrettyPrintEnv -> ConstructorReference -> Maybe (HashQualified Name) Source #
terms :: PrettyPrintEnv -> Referent -> Maybe (HashQualified Name) Source #
types :: PrettyPrintEnv -> Reference -> Maybe (HashQualified Name) Source #
allTermNames :: PrettyPrintEnv -> Referent -> [HashQualified Name] Source #
allTypeNames :: PrettyPrintEnv -> Reference -> [HashQualified Name] Source #
termName :: PrettyPrintEnv -> Referent -> HashQualified Name Source #
typeName :: PrettyPrintEnv -> Reference -> HashQualified Name Source #
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.
todoHashLength :: Int Source #
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.