Safe Haskell | None |
---|---|
Language | Haskell2010 |
- class Monad m => MonadIO m where
- class Monad m => MonadFailure m where
- class Monad m => MonadThrow m where
- class MonadThrow m => MonadCatch m where
- class MonadCatch m => MonadBracket m where
- class MonadTrans trans where
- newtype Identity a :: * -> * = Identity {
- runIdentity :: a
- replicateM :: Applicative m => CountOf a -> m a -> m [a]
Documentation
class Monad m => MonadFailure m where #
Monad that can represent failure
Similar to MonadFail but with a parametrized Failure linked to the Monad
type Failure (m :: * -> *) :: * #
The associated type with the MonadFailure, representing what failure can be encoded in this monad
MonadFailure Maybe | |
MonadFailure (Either a) | |
MonadFailure m => MonadFailure (ReaderT r m) # | |
(Functor m, MonadFailure m) => MonadFailure (StateT s m) # | |
MonadFailure m => MonadFailure (Conduit i o m) # | |
Monad state => MonadFailure (Builder collection mutCollection step state err) | |
class Monad m => MonadThrow m where #
Monad that can throw exception
throw :: Exception e => e -> m a #
Throw immediatity an exception.
Only a MonadCatch
monad will be able to catch the exception using catch
MonadThrow IO # | |
MonadThrow m => MonadThrow (ResourceT m) # | |
MonadThrow m => MonadThrow (ReaderT r m) # | |
(Functor m, MonadThrow m) => MonadThrow (StateT s m) # | |
MonadThrow m => MonadThrow (Conduit i o m) # | |
class MonadThrow m => MonadCatch m where #
Monad that can catch exception
MonadCatch IO # | |
MonadCatch m => MonadCatch (ResourceT m) # | |
MonadCatch m => MonadCatch (ReaderT r m) # | |
(Functor m, MonadCatch m) => MonadCatch (StateT s m) # | |
MonadCatch m => MonadCatch (Conduit i o m) # | |
class MonadCatch m => MonadBracket m where #
Monad that can ensure cleanup actions are performed even in the case of exceptions, both synchronous and asynchronous. This usually excludes continuation-based monads.
generalBracket :: m a -> (a -> b -> m ignored1) -> (a -> SomeException -> m ignored2) -> (a -> m b) -> m b #
A generalized version of the standard bracket function which allows distinguishing different exit cases.
MonadBracket IO # | |
MonadBracket m => MonadBracket (ResourceT m) # | |
class MonadTrans trans where #
Basic Transformer class
lift :: Monad m => m a -> trans m a #
Lift a computation from an inner monad to the current transformer monad
MonadTrans ResourceT # | |
MonadTrans (ReaderT r) # | |
MonadTrans (StateT s) # | |
MonadTrans (Conduit i o) # | |
newtype Identity a :: * -> * #
Identity functor and monad. (a non-strict monad)
Since: 4.8.0.0
Identity | |
|
replicateM :: Applicative m => CountOf a -> m a -> m [a] #
performs the action replicateM
n actn
times,
gathering the results.