Moduleghc-10.0.0.20260917GHC2024
GHC.Iface.Ext.Utils
Synopsis
- type RefMap
- value generateReferencesMap
- value renderHieType
- value resolveVisibility
- value foldType
- value selectPoint
- value findEvidenceUse
- data EvidenceInfo
- value getEvidenceTreesAtPoint
- value getEvidenceTree
- value hieTypeToIface
- data HieTypeState
- value initialHTS
- value freshTypeIndex
- value compressTypes
- value recoverFullType
- value getTypeIndex
- value resolveTyVarScopes
- value resolveTyVarScopeLocal
- value getNameBinding
- value getNameScope
- value getNameBindingInClass
- value getNameScopeAndBinding
- value getScopeFromContext
- value getBindSiteFromContext
- value flattenAst
- value smallestContainingSatisfying
- value selectLargestContainedBy
- value selectSmallestContaining
- value definedInAsts
- value getEvidenceBindDeps
- value isEvidenceBind
- value isEvidenceContext
- value isEvidenceUse
- value isOccurrence
- value scopeContainsSpan
- value combineAst
- value insertAst
- value nodeInfo
- value emptyNodeInfo
- value sourcedNodeIdents
- value combineSourcedNodeInfo
- value combineNodeInfo
- value mergeAsts
- value rightOf
- value leftOf
- value startsRightOf
- value mergeSortAsts
- value simpleNodeInfo
- value locOnly
- value locOnlyE
- value mkScope
- value combineScopes
- value mkSourcedNodeInfo
- value makeNodeA
- value makeNode
- value makeTypeNodeA
- value makeTypeNode
- Packageghc-10.0.0.20260917
- Exports58
- LanguageGHC2024
- LicenceBSD-3-Clause
- SourceUtils.hs
Constructors
Instances4Functor, Eq, Ord, Outputable
Functor EvidenceInfoDefined in ghc-10.0.0.20260917 · GHC.Iface.Ext.UtilsEq a => Eq (EvidenceInfo a)Defined in ghc-10.0.0.20260917 · GHC.Iface.Ext.UtilsOrd a => Ord (EvidenceInfo a)Defined in ghc-10.0.0.20260917 · GHC.Iface.Ext.UtilsOutputable a => Outputable (EvidenceInfo a)Defined in ghc-10.0.0.20260917 · GHC.Iface.Ext.Utils
Constructors
HTStyMap :: !TypeMap TypeIndexhtyTable :: !IntMap HieTypeFlatfreshIndex :: !TypeIndex
One must contain the other. Leaf nodes cannot contain anything
Insert an AST in a sorted list of disjoint Asts
Merge two nodes together.
Precondition and postcondition: elements in nodeType are ordered.
Merge two sorted, disjoint lists of ASTs, combining when necessary.
In the absence of position-altering pragmas (ex: # line "file.hs" 3),
different nodes in an AST tree should either have disjoint spans (in
which case you can say for sure which one comes first) or one span
should be completely contained in the other (in which case the contained
span corresponds to some child node).
However, since Haskell does have position-altering pragmas it is
possible for spans to be overlapping. Here is an example of a source file
in which foozball and quuuuuux have overlapping spans:
module Baz where
# line 3 "Baz.hs"
foozball :: Int
foozball = 0
# line 3 "Baz.hs"
bar, quuuuuux :: Int
bar = 1
quuuuuux = 2
In these cases, we just do our best to produce sensible HieAST's. The blame should be laid at the feet of whoever wrote the line pragmas in the first place (usually the C preprocessor...).
combines and sorts ASTs using a merge sort
makeNodeA :: (Monad m, Data a)=> ahelps fill in nodeAnnotations (with Data)
-> EpAnn annreturn an empty list if this is unhelpful
-> ReaderT NodeOrigin m [HieAST b]
makeNode :: (Monad m, Data a)=> ahelps fill in nodeAnnotations (with Data)
-> SrcSpanreturn an empty list if this is unhelpful
-> ReaderT NodeOrigin m [HieAST b]
makeTypeNodeA :: (Monad m, Data a)=> ahelps fill in nodeAnnotations (with Data)
-> SrcSpanAnnAreturn an empty list if this is unhelpful
-> Typetype to associate with the node
-> ReaderT NodeOrigin m [HieAST Type]
makeTypeNode :: (Monad m, Data a)=> ahelps fill in nodeAnnotations (with Data)
-> SrcSpanreturn an empty list if this is unhelpful
-> Typetype to associate with the node
-> ReaderT NodeOrigin m [HieAST Type]