| 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 => MonadIO m where #
Monads in which IO computations may be embedded.
Any monad built by applying a sequence of monad transformers to the
IO monad will be an instance of this class.
Instances should satisfy the following laws, which state that liftIO
is a transformer of monads:
Minimal complete definition
class Monad m => MonadFailure m where Source #
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 Source # | |
| MonadFailure (Either a) Source # | |
| MonadFailure m => MonadFailure (ReaderT r m) Source # | |
| (Functor m, MonadFailure m) => MonadFailure (StateT s m) Source # | |
class Monad m => MonadThrow m where Source #
Monad that can throw exception
Minimal complete definition
Methods
throw :: Exception e => e -> m a Source #
Throw immediatity an exception.
Only a MonadCatch monad will be able to catch the exception using catch
Instances
| MonadThrow IO Source # | |
| MonadThrow m => MonadThrow (ReaderT r m) Source # | |
| (Functor m, MonadThrow m) => MonadThrow (StateT s m) Source # | |
class MonadThrow m => MonadCatch m where Source #
Monad that can catch exception
Minimal complete definition
Instances
| MonadCatch IO Source # | |
| MonadCatch m => MonadCatch (ReaderT r m) Source # | |
| (Functor m, MonadCatch m) => MonadCatch (StateT s m) Source # | |