Safe Haskell | None |
---|---|
Language | Haskell2010 |
Foundation.Monad
- class Monad m => MonadIO m where
- class Monad m => MonadFailure m where
- type Failure m
- class Monad m => MonadThrow m where
- class MonadThrow m => MonadCatch m where
- class MonadTrans trans where
Documentation
class Monad m => MonadFailure m where #
Monad that can represent failure
Similar to MonadFail but with a parametrized Failure linked to the Monad
Minimal complete definition
Associated Types
The associated type with the MonadFailure, representing what failure can be encoded in this monad
Instances
MonadFailure Maybe # | |
MonadFailure (Either a) # | |
MonadFailure m => MonadFailure (ReaderT r m) # | |
(Functor m, MonadFailure m) => MonadFailure (StateT s m) # | |
class Monad m => MonadThrow m where #
Monad that can throw exception
Minimal complete definition
Methods
throw :: Exception e => e -> m a #
Throw immediatity an exception.
Only a MonadCatch
monad will be able to catch the exception using catch
Instances
MonadThrow IO # | |
MonadThrow m => MonadThrow (ReaderT r m) # | |
(Functor m, MonadThrow m) => MonadThrow (StateT s m) # | |
class MonadThrow m => MonadCatch m where #
Monad that can catch exception
Minimal complete definition
Instances
MonadCatch IO # | |
MonadCatch m => MonadCatch (ReaderT r m) # | |
(Functor m, MonadCatch m) => MonadCatch (StateT s m) # | |
class MonadTrans trans where #
Basic Transformer class
Minimal complete definition
Methods
lift :: Monad m => m a -> trans m a #
Lift a computation from an inner monad to the current transformer monad
Instances
MonadTrans (ReaderT r) # | |
MonadTrans (StateT s) # | |