hsdev-0.3.1.3: Haskell development library

Safe HaskellNone
LanguageHaskell98

HsDev.Tools.Ghc.MGhc

Contents

Synopsis

Documentation

data Session s d Source #

Constructors

Session 

Fields

Instances

(Eq d, Eq s) => Eq (Session s d) Source # 

Methods

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

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

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

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 d, Read s) => Read (Session s d) Source # 
(Show d, Show s) => Show (Session s d) Source # 

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 # 

Methods

def :: SessionState s d #

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

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 # 

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 # 

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 # 

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 # 

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 #

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

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 # 

Methods

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

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

Methods

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

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

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 # 

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 #

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

Methods

getSession :: MGhcT s d m HscEnv #

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

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

Methods

getDynFlags :: MGhcT s d m DynFlags #

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

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 # 

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 # 

Methods

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

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

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 # 

Methods

get :: GhcT m st #

put :: st -> GhcT m () #

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

MonadThrow m => MonadThrow (GhcT m) Source # 

Methods

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

MonadCatch m => MonadCatch (GhcT m) Source # 

Methods

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

MonadMask m => MonadMask (GhcT m) Source # 

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 #

MFunctor * GhcT Source # 

Methods

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

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

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 # 

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 #