Safe Haskell | Safe-Inferred |
---|---|
Language | Haskell2010 |
Attempt at hiding the GHC version differences we can.
Synopsis
- mkHomeModLocation :: DynFlags -> ModuleName -> FilePath -> IO ModLocation
- hPutStringBuffer :: Handle -> StringBuffer -> IO ()
- addIncludePathsQuote :: FilePath -> DynFlags -> DynFlags
- getModuleHash :: ModIface -> Fingerprint
- setUpTypedHoles :: DynFlags -> DynFlags
- newtype NameCacheUpdater = NCU {
- updateNameCache :: forall c. (NameCache -> (NameCache, c)) -> IO c
- upNameCache :: IORef NameCache -> (NameCache -> (NameCache, c)) -> IO c
- lookupNameCache :: Module -> OccName -> NameCache -> (NameCache, Name)
- disableWarningsAsErrors :: DynFlags -> DynFlags
- reLoc :: LocatedAn a e -> Located e
- reLocA :: Located e -> LocatedAn ann e
- getPsMessages :: PState -> DynFlags -> PsMessages
- renderMessages :: PsMessages -> (Bag WarnMsg, Bag ErrMsg)
- pattern PFailedWithErrorMessages :: forall a b. (b -> Bag (MsgEnvelope DecoratedSDoc)) -> ParseResult a
- isObjectLinkable :: Linkable -> Bool
- extendModSummaryNoDeps :: ModSummary -> ExtendedModSummary
- emsModSummary :: ExtendedModSummary -> ModSummary
- myCoreToStgExpr :: Logger -> DynFlags -> InteractiveContext -> Module -> ModLocation -> CoreExpr -> IO (Id, [StgTopBinding], InfoTableProvMap, CollectedCCs)
- data Usage
- = UsagePackageModule { }
- | UsageHomeModule { }
- | UsageFile { }
- | UsageMergedRequirement { }
- liftZonkM :: a -> a
- data FastStringCompat
- bytesFS :: FastString -> ByteString
- mkFastStringByteString :: ByteString -> FastString
- nodeInfo' :: HieAST TypeIndex -> NodeInfo TypeIndex
- getNodeIds :: 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
- nonDetOccEnvElts :: OccEnv a -> [a]
- nonDetFoldOccEnv :: (a -> b -> b) -> b -> OccEnv a -> b
- 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] -> DsM (HieASTs Type)
- writeHieFile :: FilePath -> HieFile -> IO ()
- readHieFile :: NameCacheUpdater -> FilePath -> IO HieFileResult
- setHieDir :: FilePath -> DynFlags -> DynFlags
- dontWriteHieFiles :: DynFlags -> DynFlags
- type TypeIndex = Int
- data TyVarScope
- = ResolvedScopes [Scope]
- | UnresolvedScope [Name] (Maybe Span)
- type Span = RealSrcSpan
- newtype SourcedNodeInfo a = SourcedNodeInfo {
- getSourcedNodeInfo :: Map NodeOrigin (NodeInfo a)
- data Scope
- data RecFieldContext
- data NodeOrigin
- data NodeInfo a = NodeInfo (Set NodeAnnotation) [a] (NodeIdentifiers a)
- type NodeIdentifiers a = Map Identifier (IdentifierDetails a)
- data NodeAnnotation = NodeAnnotation {}
- data IdentifierDetails a = IdentifierDetails {
- identType :: Maybe a
- identInfo :: Set ContextInfo
- type Identifier = Either ModuleName Name
- data IEType
- = Import
- | ImportAs
- | ImportHiding
- | Export
- type HieTypeFlat = HieType TypeIndex
- newtype HieTypeFix = Roll (HieType HieTypeFix)
- data HieType a
- type HiePath = LexicalFastString
- data HieName
- data HieFile = HieFile {}
- newtype HieArgs a = HieArgs [(Bool, a)]
- newtype HieASTs a = HieASTs {}
- data HieAST a = Node {
- sourcedNodeInfo :: SourcedNodeInfo a
- nodeSpan :: Span
- nodeChildren :: [HieAST a]
- data EvVarSource
- = EvPatternBind
- | EvSigBind
- | EvWrapperBind
- | EvImplicitBind
- | EvInstBind {
- isSuperInst :: Bool
- cls :: Name
- | EvLetBind EvBindDeps
- newtype EvBindDeps = EvBindDeps {
- getEvBindDeps :: [Name]
- data DeclType
- 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 BindType
- toHieName :: Name -> HieName
- pprNodeIdents :: Outputable a => NodeIdentifiers a -> SDoc
- pprIdentifier :: Identifier -> SDoc
- pprBindSpan :: Maybe Span -> SDoc
- hieVersion :: Integer
- hieNameOcc :: HieName -> OccName
- pattern HiePath :: FastString -> HiePath
- 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)
- type CoreExpr = Expr CoreBndr
- simplifyExpr :: DynFlags -> HscEnv -> CoreExpr -> IO CoreExpr
- tidyExpr :: TidyEnv -> CoreExpr -> CoreExpr
- emptyTidyEnv :: TidyEnv
- tcInitTidyEnv :: TcM TidyEnv
- corePrepExpr :: DynFlags -> HscEnv -> CoreExpr -> IO CoreExpr
- corePrepPgm :: HscEnv -> Module -> ModLocation -> CoreProgram -> [TyCon] -> IO (CoreProgram, Set CostCentre)
- lintInteractiveExpr :: SDoc -> HscEnv -> CoreExpr -> IO ()
- icInteractiveModule :: InteractiveContext -> Module
- type HomePackageTable = DModuleNameEnv HomeModInfo
- lookupHpt :: HomePackageTable -> ModuleName -> Maybe HomeModInfo
- loadModulesHome :: [HomeModInfo] -> HscEnv -> HscEnv
- data Dependencies
- 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 -> [StgTopBinding] -> [TyCon] -> Maybe ModBreaks -> IO CompiledByteCode
- bc_bcos :: CompiledByteCode -> [UnlinkedBCO]
- loadDecls :: Interp -> HscEnv -> SrcSpan -> CompiledByteCode -> IO [(Name, ForeignHValue)]
- hscInterp :: HscEnv -> Interp
- expectJust :: HasCallStack => String -> Maybe a -> a
- extract_cons :: a -> a
- recDotDot :: HsRecFields (GhcPass p) arg -> Maybe Int
Documentation
mkHomeModLocation :: DynFlags -> ModuleName -> FilePath -> IO ModLocation Source #
hPutStringBuffer :: Handle -> StringBuffer -> IO () #
getModuleHash :: ModIface -> Fingerprint Source #
setUpTypedHoles :: DynFlags -> DynFlags Source #
newtype NameCacheUpdater #
A function that atomically updates the name cache given a modifier function. The second result of the modifier function will be the result of the IO action.
NCU | |
|
getPsMessages :: PState -> DynFlags -> PsMessages Source #
renderMessages :: PsMessages -> (Bag WarnMsg, Bag ErrMsg) Source #
pattern PFailedWithErrorMessages :: forall a b. (b -> Bag (MsgEnvelope DecoratedSDoc)) -> ParseResult a Source #
isObjectLinkable :: Linkable -> Bool #
myCoreToStgExpr :: Logger -> DynFlags -> InteractiveContext -> Module -> ModLocation -> CoreExpr -> IO (Id, [StgTopBinding], 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 | |
| |
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 #
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
nonDetOccEnvElts :: OccEnv a -> [a] Source #
nonDetFoldOccEnv :: (a -> b -> b) -> b -> OccEnv a -> b Source #
isQualifiedImport :: ImportDecl a -> Bool Source #
data GhcVersion Source #
Instances
Show GhcVersion Source # | |
Defined in Development.IDE.GHC.Compat showsPrec :: Int -> GhcVersion -> ShowS # show :: GhcVersion -> String # showList :: [GhcVersion] -> ShowS # | |
Eq GhcVersion Source # | |
Defined in Development.IDE.GHC.Compat (==) :: GhcVersion -> GhcVersion -> Bool # (/=) :: GhcVersion -> GhcVersion -> Bool # | |
Ord GhcVersion Source # | |
Defined in Development.IDE.GHC.Compat compare :: GhcVersion -> GhcVersion -> Ordering # (<) :: GhcVersion -> GhcVersion -> Bool # (<=) :: GhcVersion -> GhcVersion -> Bool # (>) :: GhcVersion -> GhcVersion -> Bool # (>=) :: GhcVersion -> GhcVersion -> Bool # max :: GhcVersion -> GhcVersion -> GhcVersion # min :: GhcVersion -> GhcVersion -> GhcVersion # |
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] -> DsM (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 :: NameCacheUpdater -> FilePath -> IO HieFileResult #
dontWriteHieFiles :: DynFlags -> DynFlags Source #
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 # |
type Span = RealSrcSpan #
newtype SourcedNodeInfo a #
NodeInfos grouped by source
Instances
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 | |
data RecFieldContext #
Instances
data NodeOrigin #
Source of node info
Instances
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 |
type NodeIdentifiers a = Map Identifier (IdentifierDetails a) #
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 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 Identifier = Either ModuleName Name #
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 | |
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), ArgFlag) 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) | |
type HiePath = LexicalFastString #
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 | |
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 | |
|
A list of type arguments along with their respective visibilities (ie. is
this an argument that would return True
for isVisibleArgFlag
?).
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) | |
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 |
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 |
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 # |
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 # |
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 |
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 # |
Instances
Enum BindType | |
Binary BindType | |
Outputable BindType | |
Defined in GHC.Iface.Ext.Types | |
Eq BindType | |
Ord BindType | |
Defined in GHC.Iface.Ext.Types |
pprNodeIdents :: Outputable a => NodeIdentifiers a -> SDoc #
pprIdentifier :: Identifier -> SDoc #
pprBindSpan :: Maybe Span -> SDoc #
hieVersion :: Integer #
Current version of .hie
files
hieNameOcc :: HieName -> OccName #
pattern HiePath :: FastString -> HiePath #
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) #
emptyTidyEnv :: TidyEnv #
tcInitTidyEnv :: TcM TidyEnv #
corePrepPgm :: HscEnv -> Module -> ModLocation -> CoreProgram -> [TyCon] -> IO (CoreProgram, Set CostCentre) #
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.
data Dependencies #
Dependency information about ALL modules and packages below this one in the import hierarchy.
Invariant: the dependencies of a module M
never includes M
.
Invariant: none of the lists contain duplicates.
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 # |
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 -> [StgTopBinding] -> [TyCon] -> Maybe ModBreaks -> IO CompiledByteCode #
bc_bcos :: CompiledByteCode -> [UnlinkedBCO] #
loadDecls :: Interp -> HscEnv -> SrcSpan -> CompiledByteCode -> IO [(Name, ForeignHValue)] #
hscInterp :: HscEnv -> Interp #
Retrieve the target code interpreter
Fails if no target code interpreter is available
expectJust :: HasCallStack => String -> Maybe a -> a #
extract_cons :: a -> a Source #