Safe Haskell | None |
---|---|
Language | Haskell98 |
- data Session s d = Session {
- _sessionKey :: s
- _sessionData :: d
- sessionKey :: Lens' (Session s d) s
- sessionData :: Lens' (Session s d) d
- data SessionState s d = SessionState {
- _sessionActive :: Maybe (Session s d)
- _sessionMap :: Map s (HscEnv, d)
- sessionActive :: Lens' (SessionState s d) (Maybe (Session s d))
- sessionMap :: Lens' (SessionState s d) (Map s (HscEnv, d))
- newtype MGhcT s d m a = MGhcT {}
- runMGhcT :: (MonadIO m, ExceptionMonad m, Ord s, Monoid d) => Maybe FilePath -> MGhcT s d m a -> m a
- liftGhc :: MonadIO m => Ghc a -> MGhcT s d m a
- currentSession :: MonadIO m => MGhcT s d m (Maybe (Session s d))
- getSessionData :: MonadIO m => MGhcT s d m (Maybe d)
- setSessionData :: MonadIO m => d -> MGhcT s d m ()
- hasSession :: (MonadIO m, Ord s) => s -> MGhcT s d m Bool
- findSession :: (MonadIO m, Ord s) => s -> MGhcT s d m (Maybe (Session s d))
- findSessionBy :: MonadIO m => (s -> Bool) -> MGhcT s d m [Session s d]
- saveSession :: (MonadIO m, ExceptionMonad m, Ord s) => MGhcT s d m (Maybe (Session s d))
- initSession :: (MonadIO m, ExceptionMonad m, Ord s) => MGhcT s d m ()
- newSession :: (MonadIO m, ExceptionMonad m, Ord s, Monoid d) => s -> MGhcT s d m ()
- switchSession :: (MonadIO m, ExceptionMonad m, Ord s, Monoid d) => s -> MGhcT s d m Bool
- switchSession_ :: (MonadIO m, ExceptionMonad m, Ord s, Monoid d) => s -> Maybe (MGhcT s d m ()) -> MGhcT s d m ()
- deleteSession :: (MonadIO m, ExceptionMonad m, Ord s, Monoid d) => s -> MGhcT s d m ()
- restoreSession :: (MonadIO m, MonadMask m, ExceptionMonad m, Ord s, Monoid d) => MGhcT s d m a -> MGhcT s d m a
- usingSession :: (MonadIO m, MonadMask m, ExceptionMonad m, Ord s, Monoid d) => s -> MGhcT s d m a -> MGhcT s d m a
- tempSession :: (MonadIO m, MonadMask m, ExceptionMonad m, Ord s, Monoid d) => s -> MGhcT s d m a -> MGhcT s d m a
Documentation
Session | |
|
sessionKey :: Lens' (Session s d) s Source #
sessionData :: Lens' (Session s d) d Source #
data SessionState s d Source #
SessionState | |
|
Default (SessionState s d) Source # | |
Monad m => MonadState (SessionState s d) (MGhcT s d m) Source # | |
sessionActive :: Lens' (SessionState s d) (Maybe (Session s d)) Source #
sessionMap :: Lens' (SessionState s d) (Map s (HscEnv, d)) Source #
newtype MGhcT s d m a Source #
Multi-session ghc monad
Monad m => MonadReader (Maybe FilePath) (MGhcT s d m) Source # | |
Monad m => MonadState (SessionState s d) (MGhcT s d m) Source # | |
Monad m => Monad (MGhcT s d m) Source # | |
Functor m => Functor (MGhcT s d m) Source # | |
Monad m => Applicative (MGhcT s d m) Source # | |
MonadIO m => MonadIO (MGhcT s d m) Source # | |
MonadThrow m => MonadThrow (MGhcT s d m) Source # | |
MonadCatch m => MonadCatch (MGhcT s d m) Source # | |
MonadMask m => MonadMask (MGhcT s d m) Source # | |
ExceptionMonad m => GhcMonad (MGhcT s d m) Source # | |
MonadIO m => HasDynFlags (MGhcT s d m) Source # | |
ExceptionMonad m => ExceptionMonad (MGhcT s d m) Source # | |
MonadLog m => MonadLog (MGhcT s d m) Source # | |
runMGhcT :: (MonadIO m, ExceptionMonad m, Ord s, Monoid d) => Maybe FilePath -> MGhcT s d m a -> m a Source #
Run multi-session ghc
setSessionData :: MonadIO m => d -> MGhcT s d m () Source #
Set current session data
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 # | |
MonadReader r m => MonadReader r (GhcT m) Source # | |
MonadState st m => MonadState st (GhcT m) Source # | |
MonadThrow m => MonadThrow (GhcT m) Source # | |
MonadCatch m => MonadCatch (GhcT m) Source # | |
MonadMask m => MonadMask (GhcT m) Source # | |
MFunctor * GhcT Source # | |
ExceptionMonad m => ExceptionMonad (StateT s m) Source # | |
ExceptionMonad m => ExceptionMonad (ReaderT * r m) Source # | |