ghc-mod-5.4.0.0: Happy Haskell Programming

Safe HaskellNone
LanguageHaskell2010

Language.Haskell.GhcMod.Monad.Types

Contents

Synopsis

Monad Types

type GhcModT m = GmT (GmOutT m) Source

type GmGhc m = (IOish m, GhcMonad m) 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 GhcModEnv Source

Constructors

GhcModEnv 

Accessing GhcModEnv, GhcModState and GhcModLog

data GhcModError Source

Constructors

GMENoMsg

Unknown error

GMEString String

Some Error with a message. These are produced mostly by fail calls on GhcModT.

GMECabalConfigure GhcModError

Configuring a cabal project failed.

GMEStackConfigure GhcModError

Configuring a stack project failed.

GMEStackBootstrap GhcModError

Bootstrapping stack environment failed (process exited with failure)

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.

GMEWrongWorkingDirectory FilePath FilePath 

type Gm m = (GmEnv m, GmState m, GmLog m, GmOut m) Source

class Monad m => GmEnv m where Source

Minimal complete definition

(gmeAsk | gmeReader), gmeLocal

Methods

gmeAsk :: m GhcModEnv Source

gmeReader :: (GhcModEnv -> a) -> m a Source

gmeLocal :: (GhcModEnv -> GhcModEnv) -> m a -> m a Source

class Monad m => GmState m where Source

Minimal complete definition

gmsState | gmsGet, gmsPut

class Monad m => GmLog m where Source

Instances

class Monad m => GmOut m where Source

Methods

gmoAsk :: m GhcModOut Source

Instances

Monad m => GmOut (GmlT m) Source 
GmOut m => GmOut (GmT m) Source 
Monad m => GmOut (GmOutT m) Source 
GmOut m => GmOut (StateT s m) Source 

withOptions :: GmEnv m => (Options -> Options) -> m a -> m a Source

Re-exporting convenient stuff

class MonadIOC m => MonadIO m where Source

Methods

liftIO :: IO a -> m a Source