Safe Haskell | None |
---|---|
Language | Haskell98 |
Synopsis
- 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 | |
|
Instances
(Eq s, Eq d) => Eq (Session s d) Source # | |
(Ord s, Ord d) => Ord (Session s d) Source # | |
Defined in HsDev.Tools.Ghc.MGhc | |
(Read s, Read d) => Read (Session s d) Source # | |
(Show s, Show d) => Show (Session s d) Source # | |
sessionKey :: Lens' (Session s d) s Source #
sessionData :: Lens' (Session s d) d Source #
data SessionState s d Source #
SessionState | |
|
Instances
Default (SessionState s d) Source # | |
Defined in HsDev.Tools.Ghc.MGhc def :: SessionState s d # | |
Monad m => MonadState (SessionState s d) (MGhcT s d m) Source # | |
Defined in HsDev.Tools.Ghc.MGhc 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 # |
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
Instances
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 # | |
MonadFail m => MonadFail (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 # | |
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 # |