hsdev-0.3.3.1: Haskell development library

Safe HaskellNone
LanguageHaskell98

HsDev.Tools.Ghc.MGhc

Contents

Synopsis

Documentation

data Session s d Source #

Constructors

Session 

Fields

Instances
(Eq s, Eq d) => Eq (Session s d) Source # 
Instance details

Defined in HsDev.Tools.Ghc.MGhc

Methods

(==) :: Session s d -> Session s d -> Bool #

(/=) :: Session s d -> Session s d -> Bool #

(Ord s, Ord d) => Ord (Session s d) Source # 
Instance details

Defined in HsDev.Tools.Ghc.MGhc

Methods

compare :: Session s d -> Session s d -> Ordering #

(<) :: Session s d -> Session s d -> Bool #

(<=) :: Session s d -> Session s d -> Bool #

(>) :: Session s d -> Session s d -> Bool #

(>=) :: Session s d -> Session s d -> Bool #

max :: Session s d -> Session s d -> Session s d #

min :: Session s d -> Session s d -> Session s d #

(Read s, Read d) => Read (Session s d) Source # 
Instance details

Defined in HsDev.Tools.Ghc.MGhc

(Show s, Show d) => Show (Session s d) Source # 
Instance details

Defined in HsDev.Tools.Ghc.MGhc

Methods

showsPrec :: Int -> Session s d -> ShowS #

show :: Session s d -> String #

showList :: [Session s d] -> ShowS #

data SessionState s d Source #

Constructors

SessionState 

Fields

Instances
Default (SessionState s d) Source # 
Instance details

Defined in HsDev.Tools.Ghc.MGhc

Methods

def :: SessionState s d #

Monad m => MonadState (SessionState s d) (MGhcT s d m) Source # 
Instance details

Defined in HsDev.Tools.Ghc.MGhc

Methods

get :: MGhcT s d m (SessionState s d) #

put :: SessionState s d -> MGhcT s d m () #

state :: (SessionState s d -> (a, SessionState s d)) -> MGhcT s d m a #

newtype MGhcT s d m a Source #

Multi-session ghc monad

Constructors

MGhcT 

Fields

Instances
Monad m => MonadReader (Maybe FilePath) (MGhcT s d m) Source # 
Instance details

Defined in HsDev.Tools.Ghc.MGhc

Methods

ask :: MGhcT s d m (Maybe FilePath) #

local :: (Maybe FilePath -> Maybe FilePath) -> MGhcT s d m a -> MGhcT s d m a #

reader :: (Maybe FilePath -> a) -> MGhcT s d m a #

Monad m => MonadState (SessionState s d) (MGhcT s d m) Source # 
Instance details

Defined in HsDev.Tools.Ghc.MGhc

Methods

get :: MGhcT s d m (SessionState s d) #

put :: SessionState s d -> MGhcT s d m () #

state :: (SessionState s d -> (a, SessionState s d)) -> MGhcT s d m a #

Monad m => Monad (MGhcT s d m) Source # 
Instance details

Defined in HsDev.Tools.Ghc.MGhc

Methods

(>>=) :: MGhcT s d m a -> (a -> MGhcT s d m b) -> MGhcT s d m b #

(>>) :: MGhcT s d m a -> MGhcT s d m b -> MGhcT s d m b #

return :: a -> MGhcT s d m a #

fail :: String -> MGhcT s d m a #

Functor m => Functor (MGhcT s d m) Source # 
Instance details

Defined in HsDev.Tools.Ghc.MGhc

Methods

fmap :: (a -> b) -> MGhcT s d m a -> MGhcT s d m b #

(<$) :: a -> MGhcT s d m b -> MGhcT s d m a #

MonadFail m => MonadFail (MGhcT s d m) Source # 
Instance details

Defined in HsDev.Tools.Ghc.MGhc

Methods

fail :: String -> MGhcT s d m a #

Monad m => Applicative (MGhcT s d m) Source # 
Instance details

Defined in HsDev.Tools.Ghc.MGhc

Methods

pure :: a -> MGhcT s d m a #

(<*>) :: MGhcT s d m (a -> b) -> MGhcT s d m a -> MGhcT s d m b #

liftA2 :: (a -> b -> c) -> MGhcT s d m a -> MGhcT s d m b -> MGhcT s d m c #

(*>) :: MGhcT s d m a -> MGhcT s d m b -> MGhcT s d m b #

(<*) :: MGhcT s d m a -> MGhcT s d m b -> MGhcT s d m a #

MonadIO m => MonadIO (MGhcT s d m) Source # 
Instance details

Defined in HsDev.Tools.Ghc.MGhc

Methods

liftIO :: IO a -> MGhcT s d m a #

MonadThrow m => MonadThrow (MGhcT s d m) Source # 
Instance details

Defined in HsDev.Tools.Ghc.MGhc

Methods

throwM :: Exception e => e -> MGhcT s d m a #

MonadCatch m => MonadCatch (MGhcT s d m) Source # 
Instance details

Defined in HsDev.Tools.Ghc.MGhc

Methods

catch :: Exception e => MGhcT s d m a -> (e -> MGhcT s d m a) -> MGhcT s d m a #

MonadMask m => MonadMask (MGhcT s d m) Source # 
Instance details

Defined in HsDev.Tools.Ghc.MGhc

Methods

mask :: ((forall a. MGhcT s d m a -> MGhcT s d m a) -> MGhcT s d m b) -> MGhcT s d m b #

uninterruptibleMask :: ((forall a. MGhcT s d m a -> MGhcT s d m a) -> MGhcT s d m b) -> MGhcT s d m b #

generalBracket :: MGhcT s d m a -> (a -> ExitCase b -> MGhcT s d m c) -> (a -> MGhcT s d m b) -> MGhcT s d m (b, c) #

ExceptionMonad m => GhcMonad (MGhcT s d m) Source # 
Instance details

Defined in HsDev.Tools.Ghc.MGhc

Methods

getSession :: MGhcT s d m HscEnv #

setSession :: HscEnv -> MGhcT s d m () #

MonadIO m => HasDynFlags (MGhcT s d m) Source # 
Instance details

Defined in HsDev.Tools.Ghc.MGhc

Methods

getDynFlags :: MGhcT s d m DynFlags #

ExceptionMonad m => ExceptionMonad (MGhcT s d m) Source # 
Instance details

Defined in HsDev.Tools.Ghc.MGhc

Methods

gcatch :: Exception e => MGhcT s d m a -> (e -> MGhcT s d m a) -> MGhcT s d m a #

gmask :: ((MGhcT s d m a -> MGhcT s d m a) -> MGhcT s d m b) -> MGhcT s d m b #

gbracket :: MGhcT s d m a -> (a -> MGhcT s d m b) -> (a -> MGhcT s d m c) -> MGhcT s d m c #

gfinally :: MGhcT s d m a -> MGhcT s d m b -> MGhcT s d m a #

MonadLog m => MonadLog (MGhcT s d m) Source # 
Instance details

Defined in HsDev.Tools.Ghc.MGhc

Methods

askLog :: MGhcT s d m Log #

localLog :: (Log -> Log) -> MGhcT s d m a -> MGhcT s d m a #

runMGhcT :: (MonadIO m, ExceptionMonad m, Ord s, Monoid d) => Maybe FilePath -> MGhcT s d m a -> m a Source #

Run multi-session ghc

liftGhc :: MonadIO m => Ghc a -> MGhcT s d m a Source #

Lift Ghc monad onto MGhc

currentSession :: MonadIO m => MGhcT s d m (Maybe (Session s d)) Source #

Get current session

getSessionData :: MonadIO m => MGhcT s d m (Maybe d) Source #

Get current session data

setSessionData :: MonadIO m => d -> MGhcT s d m () Source #

Set current session data

hasSession :: (MonadIO m, Ord s) => s -> MGhcT s d m Bool Source #

Does session exist

findSession :: (MonadIO m, Ord s) => s -> MGhcT s d m (Maybe (Session s d)) Source #

Find session

findSessionBy :: MonadIO m => (s -> Bool) -> MGhcT s d m [Session s d] Source #

Find session by

saveSession :: (MonadIO m, ExceptionMonad m, Ord s) => MGhcT s d m (Maybe (Session s d)) Source #

Save current session

initSession :: (MonadIO m, ExceptionMonad m, Ord s) => MGhcT s d m () Source #

Initialize new session

newSession :: (MonadIO m, ExceptionMonad m, Ord s, Monoid d) => s -> MGhcT s d m () Source #

Create new named session, deleting existing session

switchSession :: (MonadIO m, ExceptionMonad m, Ord s, Monoid d) => s -> MGhcT s d m Bool Source #

Switch to session, creating if not exist, returns True if session was created

switchSession_ :: (MonadIO m, ExceptionMonad m, Ord s, Monoid d) => s -> Maybe (MGhcT s d m ()) -> MGhcT s d m () Source #

Switch to session, creating if not exist and initializing with passed function

deleteSession :: (MonadIO m, ExceptionMonad m, Ord s, Monoid d) => s -> MGhcT s d m () Source #

Delete existing session

restoreSession :: (MonadIO m, MonadMask m, ExceptionMonad m, Ord s, Monoid d) => MGhcT s d m a -> MGhcT s d m a Source #

Save and restore session

usingSession :: (MonadIO m, MonadMask m, ExceptionMonad m, Ord s, Monoid d) => s -> MGhcT s d m a -> MGhcT s d m a Source #

Run action using session, restoring session back

tempSession :: (MonadIO m, MonadMask m, ExceptionMonad m, Ord s, Monoid d) => s -> MGhcT s d m a -> MGhcT s d m a Source #

Run with temporary session, like usingSession, but deletes self session

Orphan instances

MonadTrans GhcT Source # 
Instance details

Methods

lift :: Monad m => m a -> GhcT m a #

MonadReader r m => MonadReader r (GhcT m) Source # 
Instance details

Methods

ask :: GhcT m r #

local :: (r -> r) -> GhcT m a -> GhcT m a #

reader :: (r -> a) -> GhcT m a #

MonadState st m => MonadState st (GhcT m) Source # 
Instance details

Methods

get :: GhcT m st #

put :: st -> GhcT m () #

state :: (st -> (a, st)) -> GhcT m a #

MonadFail m => MonadFail (GhcT m) Source # 
Instance details

Methods

fail :: String -> GhcT m a #

MonadThrow m => MonadThrow (GhcT m) Source # 
Instance details

Methods

throwM :: Exception e => e -> GhcT m a #

MonadCatch m => MonadCatch (GhcT m) Source # 
Instance details

Methods

catch :: Exception e => GhcT m a -> (e -> GhcT m a) -> GhcT m a #

MonadMask m => MonadMask (GhcT m) Source # 
Instance details

Methods

mask :: ((forall a. GhcT m a -> GhcT m a) -> GhcT m b) -> GhcT m b #

uninterruptibleMask :: ((forall a. GhcT m a -> GhcT m a) -> GhcT m b) -> GhcT m b #

generalBracket :: GhcT m a -> (a -> ExitCase b -> GhcT m c) -> (a -> GhcT m b) -> GhcT m (b, c) #

MFunctor GhcT Source # 
Instance details

Methods

hoist :: Monad m => (forall a. m a -> n a) -> GhcT m b -> GhcT n b #

ExceptionMonad m => ExceptionMonad (StateT s m) Source # 
Instance details

Methods

gcatch :: Exception e => StateT s m a -> (e -> StateT s m a) -> StateT s m a #

gmask :: ((StateT s m a -> StateT s m a) -> StateT s m b) -> StateT s m b #

gbracket :: StateT s m a -> (a -> StateT s m b) -> (a -> StateT s m c) -> StateT s m c #

gfinally :: StateT s m a -> StateT s m b -> StateT s m a #

ExceptionMonad m => ExceptionMonad (ReaderT r m) Source # 
Instance details

Methods

gcatch :: Exception e => ReaderT r m a -> (e -> ReaderT r m a) -> ReaderT r m a #

gmask :: ((ReaderT r m a -> ReaderT r m a) -> ReaderT r m b) -> ReaderT r m b #

gbracket :: ReaderT r m a -> (a -> ReaderT r m b) -> (a -> ReaderT r m c) -> ReaderT r m c #

gfinally :: ReaderT r m a -> ReaderT r m b -> ReaderT r m a #