Safe Haskell | None |
---|---|
Language | Haskell2010 |
- type GhcModT m = GmT (GmOutT m)
- newtype GmOutT m a = GmOutT {}
- newtype GmT m a = GmT {
- unGmT :: StateT GhcModState (ErrorT GhcModError (JournalT GhcModLog (ReaderT GhcModEnv m))) a
- newtype GmlT m a = GmlT {}
- newtype LightGhc a = LightGhc {
- unLightGhc :: ReaderT (IORef HscEnv) IO a
- type GmGhc m = (IOish m, GhcMonad m)
- type IOish m = (Functor m, MonadIO m, MonadBaseControl IO m, ExceptionMonad m)
- data GhcModEnv = GhcModEnv {}
- data GhcModState = GhcModState {}
- data GhcModCaches = GhcModCaches {
- gmcPackageDbStack :: CacheContents ChCacheData [GhcPkgDb]
- gmcMergedPkgOptions :: CacheContents ChCacheData [GHCOption]
- gmcComponents :: CacheContents ChCacheData [GmComponent GMCRaw ChEntrypoint]
- gmcResolvedComponents :: CacheContents [GmComponent GMCRaw (Set ModulePath)] (Map ChComponentName (GmComponent GMCResolved (Set ModulePath)))
- defaultGhcModState :: GhcModState
- data GmGhcSession = GmGhcSession {
- gmgsOptions :: ![GHCOption]
- gmgsSession :: !(IORef HscEnv)
- data GmComponent t eps = GmComponent {}
- data GmLogLevel
- data GhcModLog = GhcModLog {
- gmLogLevel :: Maybe GmLogLevel
- gmLogVomitDump :: Last Bool
- gmLogMessages :: [(GmLogLevel, String, Doc)]
- data GhcModError
- = GMENoMsg
- | GMEString String
- | GMECabalConfigure GhcModError
- | GMEStackConfigure GhcModError
- | GMEStackBootstrap GhcModError
- | GMECabalCompAssignment [(Either FilePath ModuleName, Set ChComponentName)]
- | GMEProcess String String [String] (Either Int GhcModError)
- | GMENoCabalFile
- | GMETooManyCabalFiles [FilePath]
- type Gm m = (GmEnv m, GmState m, GmLog m, GmOut m)
- class Monad m => GmEnv m where
- class Monad m => GmState m where
- class Monad m => GmLog m where
- class Monad m => GmOut m where
- cradle :: GmEnv m => m Cradle
- options :: GmEnv m => m Options
- outputOpts :: GmOut m => m OutputOpts
- withOptions :: GmEnv m => (Options -> Options) -> m a -> m a
- getMMappedFiles :: GmState m => m FileMappingMap
- setMMappedFiles :: GmState m => FileMappingMap -> m ()
- addMMappedFile :: GmState m => FilePath -> FileMapping -> m ()
- delMMappedFile :: GmState m => FilePath -> m ()
- lookupMMappedFile :: GmState m => FilePath -> m (Maybe FileMapping)
- getMMappedFilePaths :: GmState m => m [FilePath]
- class MonadIOC m => MonadIO m where
- liftIO :: MonadIO m => IO a -> m a
- gmlGetSession :: (MonadIO m, MonadBaseControl IO m) => GmlT m HscEnv
- gmlSetSession :: (MonadIO m, MonadBaseControl IO m) => HscEnv -> GmlT m ()
Monad Types
MonadTrans GmOutT Source # | |
MonadTransControl GmOutT Source # | |
MonadBaseControl IO m => MonadBase IO (GmOutT m) Source # | |
MonadBaseControl IO m => MonadBaseControl IO (GmOutT m) Source # | |
Monad m => Monad (GmOutT m) Source # | |
Functor m => Functor (GmOutT m) Source # | |
Applicative m => Applicative (GmOutT m) Source # | |
Alternative m => Alternative (GmOutT m) Source # | |
MonadPlus m => MonadPlus (GmOutT m) Source # | |
GmEnv m => GmEnv (GmOutT m) Source # | |
GmLog m => GmLog (GmOutT m) Source # | |
Monad m => GmOut (GmOutT m) Source # | |
type StT GmOutT a Source # | |
type StM (GmOutT m) a Source # | |
GmT | |
|
MonadTrans GmT Source # | |
MonadTransControl GmT Source # | |
MonadBaseControl IO m => MonadBase IO (GmT m) Source # | |
MonadBaseControl IO m => MonadBaseControl IO (GmT m) Source # | |
Monad m => MonadJournal GhcModLog (GmT m) Source # | |
Monad m => MonadError GhcModError (GmT m) Source # | |
MonadReader r m => MonadReader r (GmT m) Source # | |
MonadState s m => MonadState s (GmT m) Source # | |
Monad m => Monad (GmT m) Source # | |
Functor m => Functor (GmT m) Source # | |
Monad m => Applicative (GmT m) Source # | |
Monad m => Alternative (GmT m) Source # | |
Monad m => MonadPlus (GmT m) Source # | |
Monad m => GmEnv (GmT m) Source # | |
Monad m => GmLog (GmT m) Source # | |
GmOut m => GmOut (GmT m) Source # | |
Monad m => GmState (GmT m) Source # | |
type StT GmT a Source # | |
type StM (GmT m) a Source # | |
MonadTrans GmlT Source # | |
MonadTransControl GmlT Source # | |
MonadBaseControl IO m => MonadBase IO (GmlT m) Source # | |
MonadBaseControl IO m => MonadBaseControl IO (GmlT m) Source # | |
Monad m => MonadError GhcModError (GmlT m) Source # | |
Monad m => Monad (GmlT m) Source # | |
Functor m => Functor (GmlT m) Source # | |
Monad m => Applicative (GmlT m) Source # | |
Monad m => Alternative (GmlT m) Source # | |
Monad m => MonadPlus (GmlT m) Source # | |
(Monad m, GmEnv (GhcModT m)) => GmEnv (GmlT m) Source # | |
(Monad m, GmLog (GhcModT m)) => GmLog (GmlT m) Source # | |
Monad m => GmOut (GmlT m) Source # | |
(Monad m, GmState (GhcModT m)) => GmState (GmlT m) Source # | |
type StT GmlT a Source # | |
type StM (GmlT m) a Source # | |
type IOish m = (Functor m, MonadIO m, MonadBaseControl IO m, ExceptionMonad m) Source #
A constraint alias (-XConstraintKinds) to make functions dealing with
GhcModT
somewhat cleaner.
Basicially an IOish m => m
is a Monad
supporting arbitrary IO
and
exception handling. Usually this will simply be IO
but we parametrise it in
the exported API so users have the option to use a custom inner monad.
Environment, state and logging
data GhcModState Source #
data GhcModCaches Source #
data GmGhcSession Source #
GmGhcSession | |
|
data GmComponent t eps Source #
GmComponent | |
|
Functor (GmComponent t) Source # | |
Eq eps => Eq (GmComponent t eps) Source # | |
Ord eps => Ord (GmComponent t eps) Source # | |
Read eps => Read (GmComponent t eps) Source # | |
Show eps => Show (GmComponent t eps) Source # | |
Generic (GmComponent t eps) Source # | |
Binary eps => Binary (GmComponent t eps) Source # | |
type Rep (GmComponent t eps) Source # | |
Accessing GhcModEnv
, GhcModState
and GhcModLog
data GmLogLevel Source #
GhcModLog | |
|
data GhcModError Source #
GMENoMsg | Unknown error |
GMEString String | Some Error with a message. These are produced mostly by
|
GMECabalConfigure GhcModError | Configuring a cabal project failed. |
GMEStackConfigure GhcModError | Configuring a stack project failed. |
GMEStackBootstrap GhcModError | Bootstrapping |
GMECabalCompAssignment [(Either FilePath ModuleName, Set ChComponentName)] | Could not find a consistent component assignment for modules |
GMEProcess String String [String] (Either Int GhcModError) | Launching an operating system process failed. Fields in order: function, command, arguments, (stdout, stderr, exitcode) |
GMENoCabalFile | No cabal file found. |
GMETooManyCabalFiles [FilePath] | Too many cabal files found. |
Eq GhcModError Source # | |
Show GhcModError Source # | |
Exception GhcModError Source # | |
Error GhcModError Source # | |
Monad m => MonadError GhcModError (GmlT m) # | |
Monad m => MonadError GhcModError (GmT m) # | |
GmEnv m => GmEnv (ErrorT GhcModError m) Source # | |
class Monad m => GmState m where Source #
gmsGet :: m GhcModState Source #
gmsPut :: GhcModState -> m () Source #
gmsState :: (GhcModState -> (a, GhcModState)) -> m a Source #
class Monad m => GmLog m where Source #
(Monad m, GmLog m) => GmLog (MaybeT m) Source # | |
(Monad m, GmLog (GhcModT m)) => GmLog (GmlT m) Source # | |
Monad m => GmLog (GmT m) Source # | |
GmLog m => GmLog (GmOutT m) Source # | |
Monad m => GmLog (LogDiscardT m) Source # | |
Monad m => GmLog (JournalT GhcModLog m) Source # | |
(Monad m, GmLog m, Error e) => GmLog (ErrorT e m) Source # | |
(Monad m, GmLog m) => GmLog (StateT s m) Source # | |
(Monad m, GmLog m) => GmLog (ReaderT * r m) Source # | |
outputOpts :: GmOut m => m OutputOpts Source #
getMMappedFiles :: GmState m => m FileMappingMap Source #
setMMappedFiles :: GmState m => FileMappingMap -> m () Source #
addMMappedFile :: GmState m => FilePath -> FileMapping -> m () Source #
delMMappedFile :: GmState m => FilePath -> m () Source #
lookupMMappedFile :: GmState m => FilePath -> m (Maybe FileMapping) Source #
getMMappedFilePaths :: GmState m => m [FilePath] Source #
Re-exporting convenient stuff
gmlGetSession :: (MonadIO m, MonadBaseControl IO m) => GmlT m HscEnv Source #
Get the underlying GHC session
gmlSetSession :: (MonadIO m, MonadBaseControl IO m) => HscEnv -> GmlT m () Source #
Set the underlying GHC session
Orphan instances
GhcMonad LightGhc Source # | |
HasDynFlags LightGhc Source # | |
ExceptionMonad LightGhc Source # | |
(MonadIO m, MonadBaseControl IO m) => GhcMonad (GmlT m) Source # | |
(MonadIO m, MonadBaseControl IO m) => HasDynFlags (GmlT m) Source # | |
(MonadIO m, MonadBaseControl IO m) => ExceptionMonad (MaybeT m) Source # | |
(MonadIO m, MonadBaseControl IO m) => ExceptionMonad (GmlT m) Source # | |
(MonadIO m, MonadBaseControl IO m) => ExceptionMonad (GmT m) Source # | |
(MonadIO m, MonadBaseControl IO m) => ExceptionMonad (GmOutT m) Source # | |
(Monoid w, MonadIO m, MonadBaseControl IO m) => ExceptionMonad (JournalT w m) Source # | |
(MonadIO m, MonadBaseControl IO m) => ExceptionMonad (StateT s m) Source # | |
(MonadIO m, MonadBaseControl IO m) => ExceptionMonad (ReaderT * s m) Source # | |