Moduleghc-9.10.3GHC2021
GHC.Iface.Ext.Types
- 27 types
- 6 values
- Packageghc-9.10.3
- Exports34
- LanguageGHC2021
- LicenceBSD-3-Clause
- SourceTypes.hs
Current version of .hie files
GHC builds up a wealth of information about Haskell source as it compiles it.
.hie files are a way of persisting some of this information to disk so that
external tools that need to work with haskell source don't need to parse,
typecheck, and rename all over again. These files contain:
a simplified AST
nodes are annotated with source positions and types
identifiers are annotated with scope information
the raw bytes of the initial Haskell source
Besides saving compilation cycles, .hie files also offer a more stable
interface than the GHC API.
Constructors
HieFilehie_hs_file :: FilePathInitial Haskell source file path
hie_module :: ModuleThe module this HIE file is for
hie_types :: Array TypeIndex HieTypeFlatTypes referenced in the hie_asts.
See Note [Efficient serialization of redundant type info]
hie_asts :: HieASTs TypeIndexType-annotated abstract syntax trees
hie_exports :: [AvailInfo]The names that this module exports
hie_hs_src :: ByteStringRaw bytes of the initial Haskell source
A flattened version of Type.
See Note [Efficient serialization of redundant type info]
Constructors
HTyVarTy NameHAppTy a (HieArgs a)HTyConApp IfaceTyCon (HieArgs a)HForAllTy ((Name, a), ForAllTyFlag) aHFunTy a a aHQualTy a atype with constraint:
t1 => t2(seeIfaceDFunTy)HLitTy IfaceTyLitHCastTy aHCoercionTy
Instances5Functor, Foldable, Traversable, Eq, Binary
Functor HieTypeDefined in ghc-9.10.3 · GHC.Iface.Ext.TypesFoldable HieTypeDefined in ghc-9.10.3 · GHC.Iface.Ext.TypesTraversable HieTypeDefined in ghc-9.10.3 · GHC.Iface.Ext.TypesEq a => Eq (HieType a)Defined in ghc-9.10.3 · GHC.Iface.Ext.TypesBinary (HieType TypeIndex)Defined in ghc-9.10.3 · GHC.Iface.Ext.Types
Roughly isomorphic to the original core Type.
Constructors
Instances1Eq
Eq HieTypeFixDefined in ghc-9.10.3 · GHC.Iface.Ext.Types
A list of type arguments along with their respective visibilities (ie. is
this an argument that would return True for isVisibleForAllTyFlag?).
Instances5Functor, Foldable, Traversable, Eq, Binary
Functor HieArgsDefined in ghc-9.10.3 · GHC.Iface.Ext.TypesFoldable HieArgsDefined in ghc-9.10.3 · GHC.Iface.Ext.TypesTraversable HieArgsDefined in ghc-9.10.3 · GHC.Iface.Ext.TypesEq a => Eq (HieArgs a)Defined in ghc-9.10.3 · GHC.Iface.Ext.TypesBinary (HieArgs TypeIndex)Defined in ghc-9.10.3 · GHC.Iface.Ext.Types
Instances5Functor, Foldable, Traversable, Outputable, Binary
Functor HieASTsDefined in ghc-9.10.3 · GHC.Iface.Ext.TypesFoldable HieASTsDefined in ghc-9.10.3 · GHC.Iface.Ext.TypesTraversable HieASTsDefined in ghc-9.10.3 · GHC.Iface.Ext.TypesOutputable a => Outputable (HieASTs a)Defined in ghc-9.10.3 · GHC.Iface.Ext.TypesBinary (HieASTs TypeIndex)Defined in ghc-9.10.3 · GHC.Iface.Ext.Types
Constructors
NodesourcedNodeInfo :: SourcedNodeInfo anodeSpan :: SpannodeChildren :: [HieAST a]
Instances5Functor, Foldable, Traversable, Outputable, Binary
Functor HieASTDefined in ghc-9.10.3 · GHC.Iface.Ext.TypesFoldable HieASTDefined in ghc-9.10.3 · GHC.Iface.Ext.TypesTraversable HieASTDefined in ghc-9.10.3 · GHC.Iface.Ext.TypesOutputable a => Outputable (HieAST a)Defined in ghc-9.10.3 · GHC.Iface.Ext.TypesBinary (HieAST TypeIndex)Defined in ghc-9.10.3 · GHC.Iface.Ext.Types
NodeInfos grouped by source
Constructors
Instances5Functor, Foldable, Traversable, Outputable, Binary
Functor SourcedNodeInfoDefined in ghc-9.10.3 · GHC.Iface.Ext.TypesFoldable SourcedNodeInfoDefined in ghc-9.10.3 · GHC.Iface.Ext.TypesTraversable SourcedNodeInfoDefined in ghc-9.10.3 · GHC.Iface.Ext.TypesOutputable a => Outputable (SourcedNodeInfo a)Defined in ghc-9.10.3 · GHC.Iface.Ext.TypesBinary (SourcedNodeInfo TypeIndex)Defined in ghc-9.10.3 · GHC.Iface.Ext.Types
Source of node info
Instances5Enum, Eq, Ord, Outputable, Binary
Enum NodeOriginDefined in ghc-9.10.3 · GHC.Iface.Ext.TypesEq NodeOriginDefined in ghc-9.10.3 · GHC.Iface.Ext.TypesOrd NodeOriginDefined in ghc-9.10.3 · GHC.Iface.Ext.TypesOutputable NodeOriginDefined in ghc-9.10.3 · GHC.Iface.Ext.TypesBinary NodeOriginDefined in ghc-9.10.3 · GHC.Iface.Ext.Types
A node annotation
Constructors
NodeAnnotationnodeAnnotConstr :: !FastStringname of the AST node constructor
nodeAnnotType :: !FastStringname of the AST node Type
Instances4Eq, Ord, Outputable, Binary
Eq NodeAnnotationDefined in ghc-9.10.3 · GHC.Iface.Ext.TypesOrd NodeAnnotationDefined in ghc-9.10.3 · GHC.Iface.Ext.TypesOutputable NodeAnnotationDefined in ghc-9.10.3 · GHC.Iface.Ext.TypesBinary NodeAnnotationDefined in ghc-9.10.3 · GHC.Iface.Ext.Types
The information stored in one AST node.
The type parameter exists to provide flexibility in representation of types (see Note [Efficient serialization of redundant type info]).
Constructors
NodeInfonodeAnnotations :: Set NodeAnnotationAnnotations
nodeType :: [a]The Haskell types of this node, if any.
nodeIdentifiers :: NodeIdentifiers aAll the identifiers and their details
Instances5Functor, Foldable, Traversable, Outputable, Binary
Functor NodeInfoDefined in ghc-9.10.3 · GHC.Iface.Ext.TypesFoldable NodeInfoDefined in ghc-9.10.3 · GHC.Iface.Ext.TypesTraversable NodeInfoDefined in ghc-9.10.3 · GHC.Iface.Ext.TypesOutputable a => Outputable (NodeInfo a)Defined in ghc-9.10.3 · GHC.Iface.Ext.TypesBinary (NodeInfo TypeIndex)Defined in ghc-9.10.3 · GHC.Iface.Ext.Types
Information associated with every identifier
We need to include types with identifiers because sometimes multiple identifiers occur in the same span(Overloaded Record Fields and so on)
Constructors
Instances8Functor, Foldable, Traversable, Eq, Semigroup, Monoid, …
Functor IdentifierDetailsDefined in ghc-9.10.3 · GHC.Iface.Ext.TypesFoldable IdentifierDetailsDefined in ghc-9.10.3 · GHC.Iface.Ext.TypesTraversable IdentifierDetailsDefined in ghc-9.10.3 · GHC.Iface.Ext.TypesEq a => Eq (IdentifierDetails a)Defined in ghc-9.10.3 · GHC.Iface.Ext.TypesSemigroup (IdentifierDetails a)Defined in ghc-9.10.3 · GHC.Iface.Ext.TypesMonoid (IdentifierDetails a)Defined in ghc-9.10.3 · GHC.Iface.Ext.TypesOutputable a => Outputable (IdentifierDetails a)Defined in ghc-9.10.3 · GHC.Iface.Ext.TypesBinary (IdentifierDetails TypeIndex)Defined in ghc-9.10.3 · GHC.Iface.Ext.Types
Different contexts under which identifiers exist
Constructors
Useregular variable
MatchBindIEThing IETypeimport/export
TyDeclValBind BindType Scope (Maybe Span)Value binding
PatternBind Scope Scope (Maybe Span)Pattern binding
This case is tricky because the bound identifier can be used in two distinct scopes. Consider the following example (with
-XViewPatterns)do (b, a, (a -> True)) <- bar foo aThe identifier
ahas two scopes: in the view pattern(a -> True)and in the rest of thedo-block infoo a.ClassTyDecl (Maybe Span)Decl DeclType (Maybe Span)Declaration
TyVarBind Scope TyVarScopeType variable
RecField RecFieldContext (Maybe Span)Record field
EvidenceVarBind EvVarSource Scope (Maybe Span)Constraint/Dictionary evidence variable binding
EvidenceVarUseUsage of evidence variable
Instances4Eq, Ord, Outputable, Binary
Eq ContextInfoDefined in ghc-9.10.3 · GHC.Iface.Ext.TypesOrd ContextInfoDefined in ghc-9.10.3 · GHC.Iface.Ext.TypesOutputable ContextInfoDefined in ghc-9.10.3 · GHC.Iface.Ext.TypesBinary ContextInfoDefined in ghc-9.10.3 · GHC.Iface.Ext.Types
Constructors
EvPatternBindbound by a pattern match
EvSigBindbound by a type signature
EvWrapperBindbound by a hswrapper
EvImplicitBindbound by an implicit variable
EvInstBindBound by some instance of given class
isSuperInst :: Boolcls :: Name
EvLetBind EvBindDepsA direct let binding
Instances4Eq, Ord, Outputable, Binary
Eq EvVarSourceDefined in ghc-9.10.3 · GHC.Iface.Ext.TypesOrd EvVarSourceDefined in ghc-9.10.3 · GHC.Iface.Ext.TypesOutputable EvVarSourceDefined in ghc-9.10.3 · GHC.Iface.Ext.TypesBinary EvVarSourceDefined in ghc-9.10.3 · GHC.Iface.Ext.Types
Eq/Ord instances compare on the converted HieName, as non-exported names may have different uniques after a roundtrip
Constructors
Instances4Eq, Ord, Outputable, Binary
Eq EvBindDepsDefined in ghc-9.10.3 · GHC.Iface.Ext.TypesOrd EvBindDepsDefined in ghc-9.10.3 · GHC.Iface.Ext.TypesOutputable EvBindDepsDefined in ghc-9.10.3 · GHC.Iface.Ext.TypesBinary EvBindDepsDefined in ghc-9.10.3 · GHC.Iface.Ext.Types
Types of imports and exports
Instances5Enum, Eq, Ord, Outputable, Binary
Instances5Enum, Eq, Ord, Outputable, Binary
Enum RecFieldContextDefined in ghc-9.10.3 · GHC.Iface.Ext.TypesEq RecFieldContextDefined in ghc-9.10.3 · GHC.Iface.Ext.TypesOrd RecFieldContextDefined in ghc-9.10.3 · GHC.Iface.Ext.TypesOutputable RecFieldContextDefined in ghc-9.10.3 · GHC.Iface.Ext.TypesBinary RecFieldContextDefined in ghc-9.10.3 · GHC.Iface.Ext.Types
Instances5Enum, Eq, Ord, Outputable, Binary
Instances5Enum, Eq, Ord, Outputable, Binary
Constructors
Instances5Eq, Data, Ord, Outputable, Binary
Scope of a type variable.
This warrants a data type apart from Scope because of complexities
introduced by features like -XScopedTypeVariables and -XInstanceSigs. For
example, consider:
foo, bar, baz :: forall a. a -> a
Here a is in scope in all the definitions of foo, bar, and baz, so we
need a list of scopes to keep track of this. Furthermore, this list cannot be
computed until we resolve the binding sites of foo, bar, and baz.
Consequently, a starts with an UnresolvedScope [foo, bar, baz] Nothing
which later gets resolved into a ResolvedScopes.
Constructors
ResolvedScopes [Scope]UnresolvedScope [Name] (Maybe Span)Unresolved scopes should never show up in the final
.hiefile
Instances4Eq, Ord, Outputable, Binary
Eq TyVarScopeDefined in ghc-9.10.3 · GHC.Iface.Ext.TypesOrd TyVarScopeDefined in ghc-9.10.3 · GHC.Iface.Ext.TypesOutputable TyVarScopeDefined in ghc-9.10.3 · GHC.Iface.Ext.TypesBinary TyVarScopeDefined in ghc-9.10.3 · GHC.Iface.Ext.Types