Control.Monad.Base

transformers-base-0.4.6: Lift computations from the bottom of a transformer stack

Safe Haskell | Safe
Language | Haskell2010

Control.Monad.Base

Synopsis

- class (Applicative b, Applicative m, Monad b, Monad m) => MonadBase (b :: Type -> Type) (m :: Type -> Type) | m -> b where
  - liftBase :: b α -> m α
- liftBaseDefault :: forall t b (m :: Type -> Type) α. (MonadTrans t, MonadBase b m) => b α -> t m α

# Documentation

class (Applicative b, Applicative m, Monad b, Monad m) => MonadBase (b :: Type -> Type) (m :: Type -> Type) | m -> b where #

Methods

liftBase :: b α -> m α #

Lift a computation from the base monad

#### Instances

Instances details

MonadBase STM STM # |
Instance details Defined in Control.Monad.Base Methods liftBase :: STM α -> STM α #
MonadBase Identity Identity # |
Instance details Defined in Control.Monad.Base Methods liftBase :: Identity α -> Identity α #
MonadBase IO IO # |
Instance details Defined in Control.Monad.Base Methods liftBase :: IO α -> IO α #
MonadBase Maybe Maybe # |
Instance details Defined in Control.Monad.Base Methods liftBase :: Maybe α -> Maybe α #
MonadBase [] [] # |
Instance details Defined in Control.Monad.Base Methods liftBase :: [α] -> [α] #
MonadBase b m => MonadBase b (MaybeT m) # |
Instance details Defined in Control.Monad.Base Methods liftBase :: b α -> MaybeT m α #
(Monoid w, MonadBase b m) => MonadBase b (AccumT w m) # |
Instance details Defined in Control.Monad.Base Methods liftBase :: b α -> AccumT w m α #
MonadBase b m => MonadBase b (ExceptT e m) # |
Instance details Defined in Control.Monad.Base Methods liftBase :: b α -> ExceptT e m α #
MonadBase b m => MonadBase b (IdentityT m) # |
Instance details Defined in Control.Monad.Base Methods liftBase :: b α -> IdentityT m α #
MonadBase b m => MonadBase b (ReaderT r m) # |
Instance details Defined in Control.Monad.Base Methods liftBase :: b α -> ReaderT r m α #
MonadBase b m => MonadBase b (SelectT r m) # |
Instance details Defined in Control.Monad.Base Methods liftBase :: b α -> SelectT r m α #
MonadBase b m => MonadBase b (StateT s m) # |
Instance details Defined in Control.Monad.Base Methods liftBase :: b α -> StateT s m α #
MonadBase b m => MonadBase b (StateT s m) # |
Instance details Defined in Control.Monad.Base Methods liftBase :: b α -> StateT s m α #
(Monoid w, MonadBase b m) => MonadBase b (WriterT w m) # |
Instance details Defined in Control.Monad.Base Methods liftBase :: b α -> WriterT w m α #
(Monoid w, MonadBase b m) => MonadBase b (WriterT w m) # |
Instance details Defined in Control.Monad.Base Methods liftBase :: b α -> WriterT w m α #
(Monoid w, MonadBase b m) => MonadBase b (WriterT w m) # |
Instance details Defined in Control.Monad.Base Methods liftBase :: b α -> WriterT w m α #
MonadBase b m => MonadBase b (ContT r m) # |
Instance details Defined in Control.Monad.Base Methods liftBase :: b α -> ContT r m α #
(Monoid w, MonadBase b m) => MonadBase b (RWST r w s m) # |
Instance details Defined in Control.Monad.Base Methods liftBase :: b α -> RWST r w s m α #
(Monoid w, MonadBase b m) => MonadBase b (RWST r w s m) # |
Instance details Defined in Control.Monad.Base Methods liftBase :: b α -> RWST r w s m α #
(Monoid w, MonadBase b m) => MonadBase b (RWST r w s m) # |
Instance details Defined in Control.Monad.Base Methods liftBase :: b α -> RWST r w s m α #
MonadBase (ST s) (ST s) # |
Instance details Defined in Control.Monad.Base Methods liftBase :: ST s α -> ST s α #
MonadBase (Either e) (Either e) # |
Instance details Defined in Control.Monad.Base Methods liftBase :: Either e α -> Either e α #
MonadBase (ST s) (ST s) # |
Instance details Defined in Control.Monad.Base Methods liftBase :: ST s α -> ST s α #
MonadBase ((->) r) ((->) r) # |
Instance details Defined in Control.Monad.Base Methods liftBase :: (r -> α) -> r -> α #

liftBaseDefault :: forall t b (m :: Type -> Type) α. (MonadTrans t, MonadBase b m) => b α -> t m α #

Can be used as a default implementation for `liftBase`.

Note that: `liftBaseDefault = `lift` . `liftBase``