Safe Haskell | Safe-Inferred |
---|---|
Language | Haskell2010 |
GHC.Runtime.Context
Synopsis
- data InteractiveContext = InteractiveContext {
- ic_dflags :: DynFlags
- ic_mod_index :: Int
- ic_imports :: [InteractiveImport]
- ic_tythings :: [TyThing]
- ic_rn_gbl_env :: GlobalRdrEnv
- ic_instances :: ([ClsInst], [FamInst])
- ic_fix_env :: FixityEnv
- ic_default :: Maybe [Type]
- ic_resume :: [Resume]
- ic_monad :: Name
- ic_int_print :: Name
- ic_cwd :: Maybe FilePath
- ic_plugins :: ![LoadedPlugin]
- data InteractiveImport
- emptyInteractiveContext :: DynFlags -> InteractiveContext
- extendInteractiveContext :: InteractiveContext -> [TyThing] -> [ClsInst] -> [FamInst] -> Maybe [Type] -> FixityEnv -> InteractiveContext
- extendInteractiveContextWithIds :: InteractiveContext -> [Id] -> InteractiveContext
- setInteractivePrintName :: InteractiveContext -> Name -> InteractiveContext
- substInteractiveContext :: InteractiveContext -> TCvSubst -> InteractiveContext
- icExtendGblRdrEnv :: GlobalRdrEnv -> [TyThing] -> GlobalRdrEnv
- icInteractiveModule :: InteractiveContext -> Module
- icInScopeTTs :: InteractiveContext -> [TyThing]
- icPrintUnqual :: UnitEnv -> InteractiveContext -> PrintUnqualified
Documentation
data InteractiveContext #
Interactive context, recording information about the state of the context in which statements are executed in a GHCi session.
Constructors
InteractiveContext | |
Fields
|
data InteractiveImport #
Constructors
IIDecl (ImportDecl GhcPs) | Bring the exports of a particular module (filtered by an import decl) into scope |
IIModule ModuleName | Bring into scope the entire top-level envt of of this module, including the things imported into it. |
Instances
Outputable InteractiveImport # | |
Defined in GHC.Runtime.Context Methods ppr :: InteractiveImport -> SDoc # |
emptyInteractiveContext :: DynFlags -> InteractiveContext #
Constructs an empty InteractiveContext.
extendInteractiveContext :: InteractiveContext -> [TyThing] -> [ClsInst] -> [FamInst] -> Maybe [Type] -> FixityEnv -> InteractiveContext #
extendInteractiveContext is called with new TyThings recently defined to update the InteractiveContext to include them. Ids are easily removed when shadowed, but Classes and TyCons are not. Some work could be done to determine whether they are entirely shadowed, but as you could still have references to them (e.g. instances for classes or values of the type for TyCons), it's not clear whether removing them is even the appropriate behavior.
icExtendGblRdrEnv :: GlobalRdrEnv -> [TyThing] -> GlobalRdrEnv #
Add TyThings to the GlobalRdrEnv, earlier ones in the list shadowing later ones, and shadowing existing entries in the GlobalRdrEnv.
icInScopeTTs :: InteractiveContext -> [TyThing] #
This function returns the list of visible TyThings (useful for e.g. showBindings)
icPrintUnqual :: UnitEnv -> InteractiveContext -> PrintUnqualified #
Get the PrintUnqualified function based on the flags and this InteractiveContext