control-0.1.1.0: Class of monad transformers which control operations can be lifted thru

Safe HaskellNone
LanguageHaskell2010

Control.Monad.Base.Control

Documentation

class (Basic1 m, Monad m, Monad (Base m)) => MonadBaseControl m where Source #

Minimal complete definition

liftBaseWith, restoreM

Associated Types

type StM m a Source #

Methods

liftBaseWith :: (RunInBase m -> Base m a) -> m a Source #

restoreM :: StM m a -> m a Source #

Instances
MonadBaseControl [] Source # 
Instance details

Defined in Control.Monad.Base.Control

Associated Types

type StM [] a :: * Source #

Methods

liftBaseWith :: (RunInBase [] -> Base [] a) -> [a] Source #

restoreM :: StM [] a -> [a] Source #

MonadBaseControl Maybe Source # 
Instance details

Defined in Control.Monad.Base.Control

Associated Types

type StM Maybe a :: * Source #

MonadBaseControl IO Source # 
Instance details

Defined in Control.Monad.Base.Control

Associated Types

type StM IO a :: * Source #

Methods

liftBaseWith :: (RunInBase IO -> Base IO a) -> IO a Source #

restoreM :: StM IO a -> IO a Source #

MonadBaseControl Identity Source # 
Instance details

Defined in Control.Monad.Base.Control

Associated Types

type StM Identity a :: * Source #

MonadBaseControl STM Source # 
Instance details

Defined in Control.Monad.Base.Control

Associated Types

type StM STM a :: * Source #

Methods

liftBaseWith :: (RunInBase STM -> Base STM a) -> STM a Source #

restoreM :: StM STM a -> STM a Source #

MonadBaseControl ReadPrec Source # 
Instance details

Defined in Control.Monad.Base.Control

Associated Types

type StM ReadPrec a :: * Source #

MonadBaseControl ReadP Source # 
Instance details

Defined in Control.Monad.Base.Control

Associated Types

type StM ReadP a :: * Source #

MonadBaseControl NonEmpty Source # 
Instance details

Defined in Control.Monad.Base.Control

Associated Types

type StM NonEmpty a :: * Source #

MonadBaseControl (Either a) Source # 
Instance details

Defined in Control.Monad.Base.Control

Associated Types

type StM (Either a) a :: * Source #

Methods

liftBaseWith :: (RunInBase (Either a) -> Base (Either a) a0) -> Either a a0 Source #

restoreM :: StM (Either a) a0 -> Either a a0 Source #

Monoid a => MonadBaseControl ((,) a) Source # 
Instance details

Defined in Control.Monad.Base.Control

Associated Types

type StM ((,) a) a :: * Source #

Methods

liftBaseWith :: (RunInBase ((,) a) -> Base ((,) a) a0) -> (a, a0) Source #

restoreM :: StM ((,) a) a0 -> (a, a0) Source #

MonadBaseControl (ST a) Source # 
Instance details

Defined in Control.Monad.Base.Control

Associated Types

type StM (ST a) a :: * Source #

Methods

liftBaseWith :: (RunInBase (ST a) -> Base (ST a) a0) -> ST a a0 Source #

restoreM :: StM (ST a) a0 -> ST a a0 Source #

MonadBaseControl (ST a) Source # 
Instance details

Defined in Control.Monad.Base.Control

Associated Types

type StM (ST a) a :: * Source #

Methods

liftBaseWith :: (RunInBase (ST a) -> Base (ST a) a0) -> ST a a0 Source #

restoreM :: StM (ST a) a0 -> ST a a0 Source #

MonadBaseControl (Proxy :: * -> *) Source # 
Instance details

Defined in Control.Monad.Base.Control

Associated Types

type StM Proxy a :: * Source #

MonadBaseControl f => MonadBaseControl (MaybeT f) Source # 
Instance details

Defined in Control.Monad.Base.Control

Associated Types

type StM (MaybeT f) a :: * Source #

Methods

liftBaseWith :: (RunInBase (MaybeT f) -> Base (MaybeT f) a) -> MaybeT f a Source #

restoreM :: StM (MaybeT f) a -> MaybeT f a Source #

(MonadBaseControl f, Monoid a) => MonadBaseControl (WriterT a f) Source # 
Instance details

Defined in Control.Monad.Base.Control

Associated Types

type StM (WriterT a f) a :: * Source #

Methods

liftBaseWith :: (RunInBase (WriterT a f) -> Base (WriterT a f) a0) -> WriterT a f a0 Source #

restoreM :: StM (WriterT a f) a0 -> WriterT a f a0 Source #

(MonadBaseControl f, Monoid a) => MonadBaseControl (AccumT a f) Source # 
Instance details

Defined in Control.Monad.Base.Control

Associated Types

type StM (AccumT a f) a :: * Source #

Methods

liftBaseWith :: (RunInBase (AccumT a f) -> Base (AccumT a f) a0) -> AccumT a f a0 Source #

restoreM :: StM (AccumT a f) a0 -> AccumT a f a0 Source #

(MonadBaseControl f, Monoid a) => MonadBaseControl (WriterT a f) Source # 
Instance details

Defined in Control.Monad.Base.Control

Associated Types

type StM (WriterT a f) a :: * Source #

Methods

liftBaseWith :: (RunInBase (WriterT a f) -> Base (WriterT a f) a0) -> WriterT a f a0 Source #

restoreM :: StM (WriterT a f) a0 -> WriterT a f a0 Source #

MonadBaseControl f => MonadBaseControl (StateT a f) Source # 
Instance details

Defined in Control.Monad.Base.Control

Associated Types

type StM (StateT a f) a :: * Source #

Methods

liftBaseWith :: (RunInBase (StateT a f) -> Base (StateT a f) a0) -> StateT a f a0 Source #

restoreM :: StM (StateT a f) a0 -> StateT a f a0 Source #

MonadBaseControl f => MonadBaseControl (StateT a f) Source # 
Instance details

Defined in Control.Monad.Base.Control

Associated Types

type StM (StateT a f) a :: * Source #

Methods

liftBaseWith :: (RunInBase (StateT a f) -> Base (StateT a f) a0) -> StateT a f a0 Source #

restoreM :: StM (StateT a f) a0 -> StateT a f a0 Source #

MonadBaseControl f => MonadBaseControl (IdentityT f) Source # 
Instance details

Defined in Control.Monad.Base.Control

Associated Types

type StM (IdentityT f) a :: * Source #

MonadBaseControl f => MonadBaseControl (ExceptT a f) Source # 
Instance details

Defined in Control.Monad.Base.Control

Associated Types

type StM (ExceptT a f) a :: * Source #

Methods

liftBaseWith :: (RunInBase (ExceptT a f) -> Base (ExceptT a f) a0) -> ExceptT a f a0 Source #

restoreM :: StM (ExceptT a f) a0 -> ExceptT a f a0 Source #

MonadBaseControl ((->) a :: * -> *) Source # 
Instance details

Defined in Control.Monad.Base.Control

Associated Types

type StM ((->) a) a :: * Source #

Methods

liftBaseWith :: (RunInBase ((->) a) -> Base ((->) a) a0) -> a -> a0 Source #

restoreM :: StM ((->) a) a0 -> a -> a0 Source #

MonadBaseControl f => MonadBaseControl (ReaderT a f) Source # 
Instance details

Defined in Control.Monad.Base.Control

Associated Types

type StM (ReaderT a f) a :: * Source #

Methods

liftBaseWith :: (RunInBase (ReaderT a f) -> Base (ReaderT a f) a0) -> ReaderT a f a0 Source #

restoreM :: StM (ReaderT a f) a0 -> ReaderT a f a0 Source #

type RunInBase m = forall a. m a -> Base m (StM m a) Source #

newtype ComposeSt t m a Source #

Constructors

ComposeSt 

Fields

type RunInBaseDefault t m = forall a. t m a -> Base m (ComposeSt t m a) Source #

control :: MonadBaseControl m => (RunInBase m -> Base m (StM m a)) -> m a Source #

liftBaseOp :: MonadBaseControl m => ((a -> Base m (StM m b)) -> Base m (StM m c)) -> (a -> m b) -> m c Source #

liftBaseOp_ :: MonadBaseControl m => (Base m (StM m a) -> Base m (StM m b)) -> m a -> m b Source #

liftBaseDiscard :: MonadBaseControl m => (Base m () -> Base m a) -> m () -> m a Source #

liftBaseOpDiscard :: MonadBaseControl m => ((a -> Base m ()) -> Base m b) -> (a -> m ()) -> m b Source #