Safe Haskell | None |
---|---|
Language | Haskell98 |
This module introduces a "lighter" GhcMonad typeclass which doesn't require an instance of
ExceptionMonad
, and can therefore be used for both CoreM
and Ghc
.
Synopsis
- class HasHscEnv m
- class (Functor m, MonadIO m, HasHscEnv m, HasDynFlags m) => GhcMonadLike m
- data ModuleInfo
- data TypecheckedModule = TypecheckedModule {}
- askHscEnv :: HasHscEnv m => m HscEnv
- getModuleGraph :: GhcMonadLike m => m ModuleGraph
- getModSummary :: GhcMonadLike m => ModuleName -> m ModSummary
- lookupModSummary :: GhcMonadLike m => ModuleName -> m (Maybe ModSummary)
- lookupGlobalName :: GhcMonadLike m => Name -> m (Maybe TyThing)
- lookupName :: GhcMonadLike m => Name -> m (Maybe TyThing)
- modInfoLookupName :: GhcMonadLike m => ModuleInfo -> Name -> m (Maybe TyThing)
- moduleInfoTc :: GhcMonadLike m => ModSummary -> TcGblEnv -> m ModuleInfo
- parseModule :: GhcMonadLike m => ModSummary -> m ParsedModule
- typecheckModule :: GhcMonadLike m => ParsedModule -> m TypecheckedModule
- desugarModule :: (GhcMonadLike m, IsTypecheckedModule t) => ModSummary -> t -> m ModGuts
- findModule :: GhcMonadLike m => ModuleName -> Maybe FastString -> m Module
- lookupModule :: GhcMonadLike m => ModuleName -> Maybe FastString -> m Module
Types and type classes
Instances
HasHscEnv TcM # | |
Defined in Language.Haskell.Liquid.GHC.GhcMonadLike | |
HasHscEnv Ghc # | |
Defined in Language.Haskell.Liquid.GHC.GhcMonadLike | |
HasHscEnv Hsc # | |
Defined in Language.Haskell.Liquid.GHC.GhcMonadLike | |
HasHscEnv CoreM # | |
Defined in Language.Haskell.Liquid.GHC.GhcMonadLike | |
HasHscEnv (IfM lcl) # | |
Defined in Language.Haskell.Liquid.GHC.GhcMonadLike | |
(ExceptionMonad m, HasHscEnv m) => HasHscEnv (GhcT m) # | |
Defined in Language.Haskell.Liquid.GHC.GhcMonadLike |
class (Functor m, MonadIO m, HasHscEnv m, HasDynFlags m) => GhcMonadLike m #
A typeclass which is very similar to the existing GhcMonad
, but it doesn't impose a
ExceptionMonad
constraint.
Instances
GhcMonadLike TcM # | |
Defined in Language.Haskell.Liquid.GHC.GhcMonadLike | |
GhcMonadLike Ghc # | |
Defined in Language.Haskell.Liquid.GHC.GhcMonadLike | |
GhcMonadLike Hsc # | |
Defined in Language.Haskell.Liquid.GHC.GhcMonadLike | |
GhcMonadLike CoreM # | |
Defined in Language.Haskell.Liquid.GHC.GhcMonadLike | |
GhcMonadLike (IfM lcl) # | |
Defined in Language.Haskell.Liquid.GHC.GhcMonadLike | |
(ExceptionMonad m, GhcMonadLike m) => GhcMonadLike (GhcT m) # | |
Defined in Language.Haskell.Liquid.GHC.GhcMonadLike |
data ModuleInfo #
Our own simplified version of ModuleInfo
to overcome the fact we cannot construct the "original"
one as the constructor is not exported, and getHomeModuleInfo
and getPackageModuleInfo
are not
exported either, so we had to backport them as well.
data TypecheckedModule #
Our own simplified version of TypecheckedModule
.
Functions and typeclass methods
getModuleGraph :: GhcMonadLike m => m ModuleGraph #
getModSummary :: GhcMonadLike m => ModuleName -> m ModSummary #
lookupModSummary :: GhcMonadLike m => ModuleName -> m (Maybe ModSummary) #
lookupGlobalName :: GhcMonadLike m => Name -> m (Maybe TyThing) #
lookupName :: GhcMonadLike m => Name -> m (Maybe TyThing) #
modInfoLookupName :: GhcMonadLike m => ModuleInfo -> Name -> m (Maybe TyThing) #
moduleInfoTc :: GhcMonadLike m => ModSummary -> TcGblEnv -> m ModuleInfo #
parseModule :: GhcMonadLike m => ModSummary -> m ParsedModule #
typecheckModule :: GhcMonadLike m => ParsedModule -> m TypecheckedModule #
desugarModule :: (GhcMonadLike m, IsTypecheckedModule t) => ModSummary -> t -> m ModGuts #
Desugar a typechecked module.
findModule :: GhcMonadLike m => ModuleName -> Maybe FastString -> m Module #
Takes a ModuleName
and possibly a UnitId
, and consults the
filesystem and package database to find the corresponding Module
,
using the algorithm that is used for an import
declaration.
lookupModule :: GhcMonadLike m => ModuleName -> Maybe FastString -> m Module #