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