Safe Haskell | Safe-Inferred |
---|---|
Language | GHC2021 |
Attempt at hiding the GHC version differences we can.
Synopsis
- hPutStringBuffer :: Handle -> StringBuffer -> IO ()
- addIncludePathsQuote :: FilePath -> DynFlags -> DynFlags
- getModuleHash :: ModIface -> Fingerprint
- setUpTypedHoles :: DynFlags -> DynFlags
- lookupNameCache :: NameCache -> Module -> OccName -> IO Name
- disableWarningsAsErrors :: DynFlags -> DynFlags
- reLoc :: LocatedAn a e -> Located e
- reLocA :: Located e -> LocatedAn ann e
- renderMessages :: PsMessages -> (Bag WarnMsg, Bag ErrMsg)
- pattern PFailedWithErrorMessages :: forall a b. (b -> Bag (MsgEnvelope DecoratedSDoc)) -> ParseResult a
- myCoreToStgExpr :: Logger -> DynFlags -> InteractiveContext -> Bool -> Module -> ModLocation -> CoreExpr -> IO (Id, [CgStgTopBinding], InfoTableProvMap, CollectedCCs)
- data Usage
- = UsagePackageModule { }
- | UsageHomeModule { }
- | UsageFile { }
- | UsageHomeModuleInterface { }
- | UsageMergedRequirement { }
- data FastStringCompat
- bytesFS :: FastString -> ByteString
- mkFastStringByteString :: ByteString -> FastString
- nodeInfo' :: HieAST TypeIndex -> NodeInfo TypeIndex
- getNodeIds :: HieAST a -> Map Identifier (IdentifierDetails a)
- getSourceNodeIds :: HieAST a -> Map Identifier (IdentifierDetails a)
- sourceNodeInfo :: HieAST a -> Maybe (NodeInfo a)
- generatedNodeInfo :: HieAST a -> Maybe (NodeInfo a)
- simpleNodeInfoCompat :: FastStringCompat -> FastStringCompat -> NodeInfo a
- isAnnotationInNodeInfo :: (FastStringCompat, FastStringCompat) -> NodeInfo a -> Bool
- nodeAnnotations :: NodeInfo a -> Set (FastStringCompat, FastStringCompat)
- mkAstNode :: NodeInfo a -> Span -> [HieAST a] -> HieAST a
- combineRealSrcSpans :: RealSrcSpan -> RealSrcSpan -> RealSrcSpan
- isQualifiedImport :: ImportDecl a -> Bool
- data GhcVersion
- ghcVersion :: GhcVersion
- ghcVersionStr :: String
- data HieFileResult = HieFileResult {}
- data HieFile = HieFile {}
- hieExportNames :: HieFile -> [(SrcSpan, Name)]
- mkHieFile' :: ModSummary -> [AvailInfo] -> HieASTs Type -> ByteString -> Hsc HieFile
- enrichHie :: TypecheckedSource -> RenamedSource -> Bag EvBind -> [ClsInst] -> [TyCon] -> HieASTs Type
- writeHieFile :: FilePath -> HieFile -> IO ()
- readHieFile :: NameCache -> FilePath -> IO HieFileResult
- setHieDir :: FilePath -> DynFlags -> DynFlags
- dontWriteHieFiles :: DynFlags -> DynFlags
- data IEType
- = Import
- | ImportAs
- | ImportHiding
- | Export
- data HieName
- data TyVarScope
- = ResolvedScopes [Scope]
- | UnresolvedScope [Name] (Maybe Span)
- data Scope
- data DeclType
- data BindType
- data RecFieldContext
- newtype EvBindDeps = EvBindDeps {
- getEvBindDeps :: [Name]
- data EvVarSource
- = EvPatternBind
- | EvSigBind
- | EvWrapperBind
- | EvImplicitBind
- | EvInstBind {
- isSuperInst :: Bool
- cls :: Name
- | EvLetBind EvBindDeps
- data ContextInfo
- = Use
- | MatchBind
- | IEThing IEType
- | TyDecl
- | ValBind BindType Scope (Maybe Span)
- | PatternBind Scope Scope (Maybe Span)
- | ClassTyDecl (Maybe Span)
- | Decl DeclType (Maybe Span)
- | TyVarBind Scope TyVarScope
- | RecField RecFieldContext (Maybe Span)
- | EvidenceVarBind EvVarSource Scope (Maybe Span)
- | EvidenceVarUse
- data IdentifierDetails a = IdentifierDetails {
- identType :: Maybe a
- identInfo :: Set ContextInfo
- type NodeIdentifiers a = Map Identifier (IdentifierDetails a)
- type Identifier = Either ModuleName Name
- data NodeInfo a = NodeInfo (Set NodeAnnotation) [a] (NodeIdentifiers a)
- data NodeAnnotation = NodeAnnotation {}
- data NodeOrigin
- newtype SourcedNodeInfo a = SourcedNodeInfo {
- getSourcedNodeInfo :: Map NodeOrigin (NodeInfo a)
- data HieAST a = Node {
- sourcedNodeInfo :: SourcedNodeInfo a
- nodeSpan :: Span
- nodeChildren :: [HieAST a]
- newtype HieASTs a = HieASTs {}
- type HiePath = LexicalFastString
- newtype HieArgs a = HieArgs [(Bool, a)]
- newtype HieTypeFix = Roll (HieType HieTypeFix)
- type HieTypeFlat = HieType TypeIndex
- data HieType a
- = HTyVarTy Name
- | HAppTy a (HieArgs a)
- | HTyConApp IfaceTyCon (HieArgs a)
- | HForAllTy ((Name, a), ForAllTyFlag) a
- | HFunTy a a a
- | HQualTy a a
- | HLitTy IfaceTyLit
- | HCastTy a
- | HCoercionTy
- type TypeIndex = Int
- data HieFile = HieFile {}
- type Span = RealSrcSpan
- pattern HiePath :: FastString -> HiePath
- hieVersion :: Integer
- pprNodeIdents :: Outputable a => NodeIdentifiers a -> SDoc
- pprIdentifier :: Identifier -> SDoc
- pprBindSpan :: Maybe Span -> SDoc
- hieNameOcc :: HieName -> OccName
- toHieName :: Name -> HieName
- module Compat.HieUtils
- module Development.IDE.GHC.Compat.Core
- module Development.IDE.GHC.Compat.Env
- module Development.IDE.GHC.Compat.Iface
- module Development.IDE.GHC.Compat.Logger
- module Development.IDE.GHC.Compat.Outputable
- module Development.IDE.GHC.Compat.Parser
- module Development.IDE.GHC.Compat.Plugins
- module Development.IDE.GHC.Compat.Units
- data Option
- runUnlit :: Logger -> DynFlags -> [Option] -> IO ()
- runPp :: Logger -> DynFlags -> [Option] -> IO ()
- hscCompileCoreExprHook :: Hooks -> Maybe (HscEnv -> SrcSpan -> CoreExpr -> IO (ForeignHValue, [Linkable], PkgsLoaded))
- type CoreExpr = Expr CoreBndr
- simplifyExpr :: DynFlags -> HscEnv -> CoreExpr -> IO CoreExpr
- tidyExpr :: TidyEnv -> CoreExpr -> CoreExpr
- emptyTidyEnv :: TidyEnv
- corePrepExpr :: DynFlags -> HscEnv -> CoreExpr -> IO CoreExpr
- corePrepPgm :: Logger -> CorePrepConfig -> CorePrepPgmConfig -> Module -> ModLocation -> CoreProgram -> [TyCon] -> IO CoreProgram
- lintInteractiveExpr :: SDoc -> HscEnv -> CoreExpr -> IO ()
- icInteractiveModule :: InteractiveContext -> Module
- type HomePackageTable = DModuleNameEnv HomeModInfo
- lookupHpt :: HomePackageTable -> ModuleName -> Maybe HomeModInfo
- loadModulesHome :: [HomeModInfo] -> HscEnv -> HscEnv
- bcoFreeNames :: UnlinkedBCO -> UniqDSet Name
- type ModIfaceAnnotation = Annotation
- pattern Annotation :: CoreAnnTarget -> AnnPayload -> Annotation
- data AnnTarget name = ModuleTarget Module
- extendAnnEnvList :: AnnEnv -> [Annotation] -> AnnEnv
- module GHC.Types.Unique.DSet
- module GHC.Types.Unique.Set
- module GHC.Types.Unique.DFM
- getDependentMods :: ModIface -> [ModuleName]
- flattenBinds :: [Bind b] -> [(b, Expr b)]
- mkRnEnv2 :: InScopeSet -> RnEnv2
- emptyInScopeSet :: InScopeSet
- data Unfolding
- = NoUnfolding
- | BootUnfolding
- | OtherCon [AltCon]
- | DFunUnfolding { }
- | CoreUnfolding { }
- noUnfolding :: Unfolding
- loadExpr :: Interp -> HscEnv -> SrcSpan -> UnlinkedBCO -> IO ForeignHValue
- byteCodeGen :: HscEnv -> Module -> [CgStgTopBinding] -> [TyCon] -> Maybe ModBreaks -> IO CompiledByteCode
- bc_bcos :: CompiledByteCode -> [UnlinkedBCO]
- loadDecls :: Interp -> HscEnv -> SrcSpan -> CompiledByteCode -> IO ([(Name, ForeignHValue)], [Linkable], PkgsLoaded)
- hscInterp :: HscEnv -> Interp
- expectJust :: HasCallStack => String -> Maybe a -> a
- extract_cons :: DataDefnCons a -> [a]
- recDotDot :: HsRecFields (GhcPass p) arg -> Maybe Int
- data Dependencies
- type NameCacheUpdater = NameCache
- data XModulePs = XModulePs {}
- liftZonkM :: a -> a
- nonDetFoldOccEnv :: (a -> b -> b) -> b -> OccEnv a -> b
Documentation
hPutStringBuffer :: Handle -> StringBuffer -> IO () #
getModuleHash :: ModIface -> Fingerprint Source #
setUpTypedHoles :: DynFlags -> DynFlags Source #
renderMessages :: PsMessages -> (Bag WarnMsg, Bag ErrMsg) Source #
pattern PFailedWithErrorMessages :: forall a b. (b -> Bag (MsgEnvelope DecoratedSDoc)) -> ParseResult a Source #
myCoreToStgExpr :: Logger -> DynFlags -> InteractiveContext -> Bool -> Module -> ModLocation -> CoreExpr -> IO (Id, [CgStgTopBinding], InfoTableProvMap, CollectedCCs) Source #
Records modules for which changes may force recompilation of this module See wiki: https://gitlab.haskell.org/ghc/ghc/wikis/commentary/compiler/recompilation-avoidance
This differs from Dependencies. A module X may be in the dep_mods of this module (via an import chain) but if we don't use anything from X it won't appear in our Usage
UsagePackageModule | Module from another package |
| |
UsageHomeModule | Module from the current package |
| |
UsageFile | A file upon which the module depends, e.g. a CPP #include, or using TH's
|
| |
UsageHomeModuleInterface | |
| |
UsageMergedRequirement | A requirement which was merged into this one. |
|
data FastStringCompat Source #
Instances
IsString FastStringCompat Source # | |
Defined in Development.IDE.GHC.Compat fromString :: String -> FastStringCompat # | |
Show FastStringCompat Source # | |
Defined in Development.IDE.GHC.Compat showsPrec :: Int -> FastStringCompat -> ShowS # show :: FastStringCompat -> String # showList :: [FastStringCompat] -> ShowS # | |
Eq FastStringCompat Source # | |
Defined in Development.IDE.GHC.Compat (==) :: FastStringCompat -> FastStringCompat -> Bool # (/=) :: FastStringCompat -> FastStringCompat -> Bool # | |
Ord FastStringCompat Source # | |
Defined in Development.IDE.GHC.Compat compare :: FastStringCompat -> FastStringCompat -> Ordering # (<) :: FastStringCompat -> FastStringCompat -> Bool # (<=) :: FastStringCompat -> FastStringCompat -> Bool # (>) :: FastStringCompat -> FastStringCompat -> Bool # (>=) :: FastStringCompat -> FastStringCompat -> Bool # max :: FastStringCompat -> FastStringCompat -> FastStringCompat # min :: FastStringCompat -> FastStringCompat -> FastStringCompat # |
bytesFS :: FastString -> ByteString #
Gives the Modified UTF-8 encoded bytes corresponding to a FastString
mkFastStringByteString :: ByteString -> FastString #
Create a FastString
by copying an existing ByteString
getNodeIds :: HieAST a -> Map Identifier (IdentifierDetails a) Source #
getSourceNodeIds :: HieAST a -> Map Identifier (IdentifierDetails a) Source #
Like getNodeIds but with generated node removed
isAnnotationInNodeInfo :: (FastStringCompat, FastStringCompat) -> NodeInfo a -> Bool Source #
nodeAnnotations :: NodeInfo a -> Set (FastStringCompat, FastStringCompat) Source #
combineRealSrcSpans :: RealSrcSpan -> RealSrcSpan -> RealSrcSpan #
Combines two SrcSpan
into one that spans at least all the characters
within both spans. Assumes the "file" part is the same in both inputs
isQualifiedImport :: ImportDecl a -> Bool Source #
data GhcVersion Source #
Instances
HIE Compat
data HieFileResult #
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.
HieFile | |
|
mkHieFile' :: ModSummary -> [AvailInfo] -> HieASTs Type -> ByteString -> Hsc HieFile Source #
enrichHie :: TypecheckedSource -> RenamedSource -> Bag EvBind -> [ClsInst] -> [TyCon] -> HieASTs Type #
writeHieFile :: FilePath -> HieFile -> IO () #
Write a HieFile
to the given FilePath
, with a proper header and
symbol tables for Name
s and FastString
s
readHieFile :: NameCache -> FilePath -> IO HieFileResult #
dontWriteHieFiles :: DynFlags -> DynFlags Source #
Types of imports and exports
Instances
Enum IEType | |
Defined in GHC.Iface.Ext.Types | |
Binary IEType | |
Outputable IEType | |
Defined in GHC.Iface.Ext.Types | |
Eq IEType | |
Ord IEType | |
Name
's get converted into HieName
's before being written into .hie
files. See toHieName
and fromHieName
for logic on how to convert between
these two types.
Instances
Outputable HieName | |
Defined in GHC.Iface.Ext.Types | |
Eq HieName | |
Ord HieName | |
data TyVarScope #
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
which later gets resolved into a UnresolvedScope
[foo, bar, baz] NothingResolvedScopes
.
ResolvedScopes [Scope] | |
UnresolvedScope | Unresolved scopes should never show up in the final |
Instances
Binary TyVarScope | |
Defined in GHC.Iface.Ext.Types put_ :: BinHandle -> TyVarScope -> IO () # put :: BinHandle -> TyVarScope -> IO (Bin TyVarScope) # get :: BinHandle -> IO TyVarScope # | |
Outputable TyVarScope | |
Defined in GHC.Iface.Ext.Types ppr :: TyVarScope -> SDoc # | |
Eq TyVarScope | |
Defined in GHC.Iface.Ext.Types (==) :: TyVarScope -> TyVarScope -> Bool # (/=) :: TyVarScope -> TyVarScope -> Bool # | |
Ord TyVarScope | |
Defined in GHC.Iface.Ext.Types compare :: TyVarScope -> TyVarScope -> Ordering # (<) :: TyVarScope -> TyVarScope -> Bool # (<=) :: TyVarScope -> TyVarScope -> Bool # (>) :: TyVarScope -> TyVarScope -> Bool # (>=) :: TyVarScope -> TyVarScope -> Bool # max :: TyVarScope -> TyVarScope -> TyVarScope # min :: TyVarScope -> TyVarScope -> TyVarScope # |
Instances
Data Scope | |
Defined in GHC.Iface.Ext.Types gfoldl :: (forall d b. Data d => c (d -> b) -> d -> c b) -> (forall g. g -> c g) -> Scope -> c Scope # gunfold :: (forall b r. Data b => c (b -> r) -> c r) -> (forall r. r -> c r) -> Constr -> c Scope # dataTypeOf :: Scope -> DataType # dataCast1 :: Typeable t => (forall d. Data d => c (t d)) -> Maybe (c Scope) # dataCast2 :: Typeable t => (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c Scope) # gmapT :: (forall b. Data b => b -> b) -> Scope -> Scope # gmapQl :: (r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> Scope -> r # gmapQr :: forall r r'. (r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> Scope -> r # gmapQ :: (forall d. Data d => d -> u) -> Scope -> [u] # gmapQi :: Int -> (forall d. Data d => d -> u) -> Scope -> u # gmapM :: Monad m => (forall d. Data d => d -> m d) -> Scope -> m Scope # gmapMp :: MonadPlus m => (forall d. Data d => d -> m d) -> Scope -> m Scope # gmapMo :: MonadPlus m => (forall d. Data d => d -> m d) -> Scope -> m Scope # | |
Binary Scope | |
Outputable Scope | |
Defined in GHC.Iface.Ext.Types | |
Eq Scope | |
Ord Scope | |
FamDec | type or data family |
SynDec | type synonym |
DataDec | data declaration |
ConDec | constructor declaration |
PatSynDec | pattern synonym |
ClassDec | class declaration |
InstDec | instance declaration |
Instances
Enum DeclType | |
Binary DeclType | |
Outputable DeclType | |
Defined in GHC.Iface.Ext.Types | |
Eq DeclType | |
Ord DeclType | |
Defined in GHC.Iface.Ext.Types |
Instances
Enum BindType | |
Binary BindType | |
Outputable BindType | |
Defined in GHC.Iface.Ext.Types | |
Eq BindType | |
Ord BindType | |
Defined in GHC.Iface.Ext.Types |
data RecFieldContext #
Instances
newtype EvBindDeps #
Eq/Ord instances compare on the converted HieName, as non-exported names may have different uniques after a roundtrip
EvBindDeps | |
|
Instances
Binary EvBindDeps | |
Defined in GHC.Iface.Ext.Types put_ :: BinHandle -> EvBindDeps -> IO () # put :: BinHandle -> EvBindDeps -> IO (Bin EvBindDeps) # get :: BinHandle -> IO EvBindDeps # | |
Outputable EvBindDeps | |
Defined in GHC.Iface.Ext.Types ppr :: EvBindDeps -> SDoc # | |
Eq EvBindDeps | |
Defined in GHC.Iface.Ext.Types (==) :: EvBindDeps -> EvBindDeps -> Bool # (/=) :: EvBindDeps -> EvBindDeps -> Bool # | |
Ord EvBindDeps | |
Defined in GHC.Iface.Ext.Types compare :: EvBindDeps -> EvBindDeps -> Ordering # (<) :: EvBindDeps -> EvBindDeps -> Bool # (<=) :: EvBindDeps -> EvBindDeps -> Bool # (>) :: EvBindDeps -> EvBindDeps -> Bool # (>=) :: EvBindDeps -> EvBindDeps -> Bool # max :: EvBindDeps -> EvBindDeps -> EvBindDeps # min :: EvBindDeps -> EvBindDeps -> EvBindDeps # |
data EvVarSource #
EvPatternBind | bound by a pattern match |
EvSigBind | bound by a type signature |
EvWrapperBind | bound by a hswrapper |
EvImplicitBind | bound by an implicit variable |
EvInstBind | Bound by some instance of given class |
| |
EvLetBind EvBindDeps | A direct let binding |
Instances
Binary EvVarSource | |
Defined in GHC.Iface.Ext.Types put_ :: BinHandle -> EvVarSource -> IO () # put :: BinHandle -> EvVarSource -> IO (Bin EvVarSource) # get :: BinHandle -> IO EvVarSource # | |
Outputable EvVarSource | |
Defined in GHC.Iface.Ext.Types ppr :: EvVarSource -> SDoc # | |
Eq EvVarSource | |
Defined in GHC.Iface.Ext.Types (==) :: EvVarSource -> EvVarSource -> Bool # (/=) :: EvVarSource -> EvVarSource -> Bool # | |
Ord EvVarSource | |
Defined in GHC.Iface.Ext.Types compare :: EvVarSource -> EvVarSource -> Ordering # (<) :: EvVarSource -> EvVarSource -> Bool # (<=) :: EvVarSource -> EvVarSource -> Bool # (>) :: EvVarSource -> EvVarSource -> Bool # (>=) :: EvVarSource -> EvVarSource -> Bool # max :: EvVarSource -> EvVarSource -> EvVarSource # min :: EvVarSource -> EvVarSource -> EvVarSource # |
data ContextInfo #
Different contexts under which identifiers exist
Use | regular variable |
MatchBind | |
IEThing IEType | import/export |
TyDecl | |
ValBind | Value binding |
PatternBind | Pattern binding This case is tricky because the bound identifier can be used in two
distinct scopes. Consider the following example (with do (b, a, (a -> True)) <- bar foo a The identifier |
ClassTyDecl (Maybe Span) | |
Decl | Declaration |
TyVarBind Scope TyVarScope | Type variable |
RecField RecFieldContext (Maybe Span) | Record field |
EvidenceVarBind | Constraint/Dictionary evidence variable binding |
| |
EvidenceVarUse | Usage of evidence variable |
Instances
Binary ContextInfo | |
Defined in GHC.Iface.Ext.Types put_ :: BinHandle -> ContextInfo -> IO () # put :: BinHandle -> ContextInfo -> IO (Bin ContextInfo) # get :: BinHandle -> IO ContextInfo # | |
Outputable ContextInfo | |
Defined in GHC.Iface.Ext.Types ppr :: ContextInfo -> SDoc # | |
Eq ContextInfo | |
Defined in GHC.Iface.Ext.Types (==) :: ContextInfo -> ContextInfo -> Bool # (/=) :: ContextInfo -> ContextInfo -> Bool # | |
Ord ContextInfo | |
Defined in GHC.Iface.Ext.Types compare :: ContextInfo -> ContextInfo -> Ordering # (<) :: ContextInfo -> ContextInfo -> Bool # (<=) :: ContextInfo -> ContextInfo -> Bool # (>) :: ContextInfo -> ContextInfo -> Bool # (>=) :: ContextInfo -> ContextInfo -> Bool # max :: ContextInfo -> ContextInfo -> ContextInfo # min :: ContextInfo -> ContextInfo -> ContextInfo # |
data IdentifierDetails a #
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)
Instances
type NodeIdentifiers a = Map Identifier (IdentifierDetails a) #
type Identifier = Either ModuleName Name #
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]).
NodeInfo (Set NodeAnnotation) [a] (NodeIdentifiers a) |
Instances
Foldable NodeInfo | |
Defined in GHC.Iface.Ext.Types fold :: Monoid m => NodeInfo m -> m # foldMap :: Monoid m => (a -> m) -> NodeInfo a -> m # foldMap' :: Monoid m => (a -> m) -> NodeInfo a -> m # foldr :: (a -> b -> b) -> b -> NodeInfo a -> b # foldr' :: (a -> b -> b) -> b -> NodeInfo a -> b # foldl :: (b -> a -> b) -> b -> NodeInfo a -> b # foldl' :: (b -> a -> b) -> b -> NodeInfo a -> b # foldr1 :: (a -> a -> a) -> NodeInfo a -> a # foldl1 :: (a -> a -> a) -> NodeInfo a -> a # elem :: Eq a => a -> NodeInfo a -> Bool # maximum :: Ord a => NodeInfo a -> a # minimum :: Ord a => NodeInfo a -> a # | |
Traversable NodeInfo | |
Functor NodeInfo | |
Binary (NodeInfo TypeIndex) | |
Outputable a => Outputable (NodeInfo a) | |
Defined in GHC.Iface.Ext.Types |
data NodeAnnotation #
A node annotation
NodeAnnotation | |
|
Instances
Binary NodeAnnotation | |
Defined in GHC.Iface.Ext.Types put_ :: BinHandle -> NodeAnnotation -> IO () # put :: BinHandle -> NodeAnnotation -> IO (Bin NodeAnnotation) # get :: BinHandle -> IO NodeAnnotation # | |
Outputable NodeAnnotation | |
Defined in GHC.Iface.Ext.Types ppr :: NodeAnnotation -> SDoc # | |
Eq NodeAnnotation | |
Defined in GHC.Iface.Ext.Types (==) :: NodeAnnotation -> NodeAnnotation -> Bool # (/=) :: NodeAnnotation -> NodeAnnotation -> Bool # | |
Ord NodeAnnotation | |
Defined in GHC.Iface.Ext.Types compare :: NodeAnnotation -> NodeAnnotation -> Ordering # (<) :: NodeAnnotation -> NodeAnnotation -> Bool # (<=) :: NodeAnnotation -> NodeAnnotation -> Bool # (>) :: NodeAnnotation -> NodeAnnotation -> Bool # (>=) :: NodeAnnotation -> NodeAnnotation -> Bool # max :: NodeAnnotation -> NodeAnnotation -> NodeAnnotation # min :: NodeAnnotation -> NodeAnnotation -> NodeAnnotation # |
data NodeOrigin #
Source of node info
Instances
newtype SourcedNodeInfo a #
NodeInfos grouped by source
Instances
Node | |
|
Instances
Foldable HieAST | |
Defined in GHC.Iface.Ext.Types fold :: Monoid m => HieAST m -> m # foldMap :: Monoid m => (a -> m) -> HieAST a -> m # foldMap' :: Monoid m => (a -> m) -> HieAST a -> m # foldr :: (a -> b -> b) -> b -> HieAST a -> b # foldr' :: (a -> b -> b) -> b -> HieAST a -> b # foldl :: (b -> a -> b) -> b -> HieAST a -> b # foldl' :: (b -> a -> b) -> b -> HieAST a -> b # foldr1 :: (a -> a -> a) -> HieAST a -> a # foldl1 :: (a -> a -> a) -> HieAST a -> a # elem :: Eq a => a -> HieAST a -> Bool # maximum :: Ord a => HieAST a -> a # minimum :: Ord a => HieAST a -> a # | |
Traversable HieAST | |
Functor HieAST | |
Binary (HieAST TypeIndex) | |
Outputable a => Outputable (HieAST a) | |
Defined in GHC.Iface.Ext.Types |
Mapping from filepaths to the corresponding AST
Instances
Foldable HieASTs | |
Defined in GHC.Iface.Ext.Types fold :: Monoid m => HieASTs m -> m # foldMap :: Monoid m => (a -> m) -> HieASTs a -> m # foldMap' :: Monoid m => (a -> m) -> HieASTs a -> m # foldr :: (a -> b -> b) -> b -> HieASTs a -> b # foldr' :: (a -> b -> b) -> b -> HieASTs a -> b # foldl :: (b -> a -> b) -> b -> HieASTs a -> b # foldl' :: (b -> a -> b) -> b -> HieASTs a -> b # foldr1 :: (a -> a -> a) -> HieASTs a -> a # foldl1 :: (a -> a -> a) -> HieASTs a -> a # elem :: Eq a => a -> HieASTs a -> Bool # maximum :: Ord a => HieASTs a -> a # minimum :: Ord a => HieASTs a -> a # | |
Traversable HieASTs | |
Functor HieASTs | |
Binary (HieASTs TypeIndex) | |
Outputable a => Outputable (HieASTs a) | |
Defined in GHC.Iface.Ext.Types |
type HiePath = LexicalFastString #
A list of type arguments along with their respective visibilities (ie. is
this an argument that would return True
for isVisibleForAllTyFlag
?).
Instances
Foldable HieArgs | |
Defined in GHC.Iface.Ext.Types fold :: Monoid m => HieArgs m -> m # foldMap :: Monoid m => (a -> m) -> HieArgs a -> m # foldMap' :: Monoid m => (a -> m) -> HieArgs a -> m # foldr :: (a -> b -> b) -> b -> HieArgs a -> b # foldr' :: (a -> b -> b) -> b -> HieArgs a -> b # foldl :: (b -> a -> b) -> b -> HieArgs a -> b # foldl' :: (b -> a -> b) -> b -> HieArgs a -> b # foldr1 :: (a -> a -> a) -> HieArgs a -> a # foldl1 :: (a -> a -> a) -> HieArgs a -> a # elem :: Eq a => a -> HieArgs a -> Bool # maximum :: Ord a => HieArgs a -> a # minimum :: Ord a => HieArgs a -> a # | |
Traversable HieArgs | |
Functor HieArgs | |
Binary (HieArgs TypeIndex) | |
Eq a => Eq (HieArgs a) | |
newtype HieTypeFix #
Roughly isomorphic to the original core Type
.
Instances
Eq HieTypeFix | |
Defined in GHC.Iface.Ext.Types (==) :: HieTypeFix -> HieTypeFix -> Bool # (/=) :: HieTypeFix -> HieTypeFix -> Bool # |
type HieTypeFlat = HieType TypeIndex #
A flattened version of Type
.
See Note [Efficient serialization of redundant type info]
HTyVarTy Name | |
HAppTy a (HieArgs a) | |
HTyConApp IfaceTyCon (HieArgs a) | |
HForAllTy ((Name, a), ForAllTyFlag) a | |
HFunTy a a a | |
HQualTy a a | type with constraint: |
HLitTy IfaceTyLit | |
HCastTy a | |
HCoercionTy |
Instances
Foldable HieType | |
Defined in GHC.Iface.Ext.Types fold :: Monoid m => HieType m -> m # foldMap :: Monoid m => (a -> m) -> HieType a -> m # foldMap' :: Monoid m => (a -> m) -> HieType a -> m # foldr :: (a -> b -> b) -> b -> HieType a -> b # foldr' :: (a -> b -> b) -> b -> HieType a -> b # foldl :: (b -> a -> b) -> b -> HieType a -> b # foldl' :: (b -> a -> b) -> b -> HieType a -> b # foldr1 :: (a -> a -> a) -> HieType a -> a # foldl1 :: (a -> a -> a) -> HieType a -> a # elem :: Eq a => a -> HieType a -> Bool # maximum :: Ord a => HieType a -> a # minimum :: Ord a => HieType a -> a # | |
Traversable HieType | |
Functor HieType | |
Binary (HieType TypeIndex) | |
Eq a => Eq (HieType a) | |
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.
HieFile | |
|
type Span = RealSrcSpan #
pattern HiePath :: FastString -> HiePath #
hieVersion :: Integer #
Current version of .hie
files
pprNodeIdents :: Outputable a => NodeIdentifiers a -> SDoc #
pprIdentifier :: Identifier -> SDoc #
pprBindSpan :: Maybe Span -> SDoc #
hieNameOcc :: HieName -> OccName #
module Compat.HieUtils
Compat modules
Extras that rely on compat modules
SysTools
When invoking external tools as part of the compilation pipeline, we pass these a sequence of options on the command-line. Rather than just using a list of Strings, we use a type that allows us to distinguish between filepaths and 'other stuff'. The reason for this is that this type gives us a handle on transforming filenames, and filenames only, to whatever format they're expected to be on a particular platform.
Recompilation avoidance
hscCompileCoreExprHook :: Hooks -> Maybe (HscEnv -> SrcSpan -> CoreExpr -> IO (ForeignHValue, [Linkable], PkgsLoaded)) #
emptyTidyEnv :: TidyEnv #
corePrepPgm :: Logger -> CorePrepConfig -> CorePrepPgmConfig -> Module -> ModLocation -> CoreProgram -> [TyCon] -> IO CoreProgram #
type HomePackageTable = DModuleNameEnv HomeModInfo #
Helps us find information about modules in the home package
lookupHpt :: HomePackageTable -> ModuleName -> Maybe HomeModInfo #
loadModulesHome :: [HomeModInfo] -> HscEnv -> HscEnv Source #
Load modules, quickly. Input doesn't need to be desugared. A module must be loaded before dependent modules can be typechecked. This variant of loadModuleHome will *never* cause recompilation, it just modifies the session. The order modules are loaded is important when there are hs-boot files. In particular you should make sure to load the .hs version of a file after the .hs-boot version.
bcoFreeNames :: UnlinkedBCO -> UniqDSet Name #
Finds external references. Remember to remove the names defined by this group of BCOs themselves
type ModIfaceAnnotation = Annotation Source #
pattern Annotation :: CoreAnnTarget -> AnnPayload -> Annotation #
An annotation target
ModuleTarget Module | We are annotating a particular module |
Instances
Functor AnnTarget | |
Binary name => Binary (AnnTarget name) | |
Outputable name => Outputable (AnnTarget name) | |
Defined in GHC.Types.Annotations |
extendAnnEnvList :: AnnEnv -> [Annotation] -> AnnEnv #
Add the given annotation to the environment.
module GHC.Types.Unique.DSet
module GHC.Types.Unique.Set
module GHC.Types.Unique.DFM
getDependentMods :: ModIface -> [ModuleName] Source #
flattenBinds :: [Bind b] -> [(b, Expr b)] #
Collapse all the bindings in the supplied groups into a single
list of lhs/rhs pairs suitable for binding in a Rec
binding group
mkRnEnv2 :: InScopeSet -> RnEnv2 #
Records the unfolding of an identifier, which is approximately the form the identifier would have if we substituted its definition in for the identifier. This type should be treated as abstract everywhere except in GHC.Core.Unfold
NoUnfolding | We have no information about the unfolding. |
BootUnfolding | We have no information about the unfolding, because
this |
OtherCon [AltCon] | It ain't one of these constructors.
data C = C !(Int -> Int) case x of { C f -> ... } Here, |
DFunUnfolding | |
CoreUnfolding | An unfolding with redundant cached information. Parameters: uf_tmpl: Template used to perform unfolding; NB: Occurrence info is guaranteed correct: see Note [OccInfo in unfoldings and rules] uf_is_top: Is this a top level binding? uf_is_value: uf_is_work_free: Does this waste only a little work if we expand it inside an inlining?
Basically this is a cached version of uf_guidance: Tells us about the size of the unfolding template |
There is no known Unfolding
loadExpr :: Interp -> HscEnv -> SrcSpan -> UnlinkedBCO -> IO ForeignHValue #
Load a single expression, including first loading packages and modules that this expression depends on.
Raises an IO exception (ProgramError
) if it can't find a compiled
version of the dependents to load.
byteCodeGen :: HscEnv -> Module -> [CgStgTopBinding] -> [TyCon] -> Maybe ModBreaks -> IO CompiledByteCode #
bc_bcos :: CompiledByteCode -> [UnlinkedBCO] #
loadDecls :: Interp -> HscEnv -> SrcSpan -> CompiledByteCode -> IO ([(Name, ForeignHValue)], [Linkable], PkgsLoaded) #
hscInterp :: HscEnv -> Interp #
Retrieve the target code interpreter
Fails if no target code interpreter is available
expectJust :: HasCallStack => String -> Maybe a -> a #
extract_cons :: DataDefnCons a -> [a] Source #
data Dependencies #
Dependency information about ALL modules and packages below this one
in the import hierarchy. This is the serialisable version of ImportAvails
.
Invariant: the dependencies of a module M
never includes M
.
Invariant: none of the lists contain duplicates.
Invariant: lists are ordered canonically (e.g. using stableModuleCmp)
See Note [Transitive Information in Dependencies]
Instances
Binary Dependencies | |
Defined in GHC.Unit.Module.Deps put_ :: BinHandle -> Dependencies -> IO () # put :: BinHandle -> Dependencies -> IO (Bin Dependencies) # get :: BinHandle -> IO Dependencies # | |
Eq Dependencies | |
Defined in GHC.Unit.Module.Deps (==) :: Dependencies -> Dependencies -> Bool # (/=) :: Dependencies -> Dependencies -> Bool # |
type NameCacheUpdater = NameCache Source #
Haskell Module extension point: GHC specific
XModulePs | |
|
Instances
Data XModulePs | |
Defined in GHC.Hs gfoldl :: (forall d b. Data d => c (d -> b) -> d -> c b) -> (forall g. g -> c g) -> XModulePs -> c XModulePs # gunfold :: (forall b r. Data b => c (b -> r) -> c r) -> (forall r. r -> c r) -> Constr -> c XModulePs # toConstr :: XModulePs -> Constr # dataTypeOf :: XModulePs -> DataType # dataCast1 :: Typeable t => (forall d. Data d => c (t d)) -> Maybe (c XModulePs) # dataCast2 :: Typeable t => (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c XModulePs) # gmapT :: (forall b. Data b => b -> b) -> XModulePs -> XModulePs # gmapQl :: (r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> XModulePs -> r # gmapQr :: forall r r'. (r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> XModulePs -> r # gmapQ :: (forall d. Data d => d -> u) -> XModulePs -> [u] # gmapQi :: Int -> (forall d. Data d => d -> u) -> XModulePs -> u # gmapM :: Monad m => (forall d. Data d => d -> m d) -> XModulePs -> m XModulePs # gmapMp :: MonadPlus m => (forall d. Data d => d -> m d) -> XModulePs -> m XModulePs # gmapMo :: MonadPlus m => (forall d. Data d => d -> m d) -> XModulePs -> m XModulePs # |
nonDetFoldOccEnv :: (a -> b -> b) -> b -> OccEnv a -> b Source #