fused-effects-resumable-0.1.0.0: Resumable exceptions for the fused-effects ecosystem.

Safe HaskellNone
LanguageHaskell2010

Control.Carrier.Resumable.Resume

Contents

Description

Provides a carrier for Resumable that can, given a handler function, resume the computation that threw an exception.

Synopsis

Resumable carrier

runResumable :: (forall x. err x -> m x) -> ResumableC err m a -> m a Source #

Run a Resumable effect, resuming uncaught errors with a given handler.

Note that this may be less efficient than defining a specialized carrier type and instance specifying the handler’s behaviour directly. Performance-critical code may wish to do that to maximize the opportunities for fusion and inlining.

runResumable f (pure a) = pure a
runResumable f (throwResumable e) = f e

Since: 0.1.0.0

newtype ResumableC err m a Source #

Since: 0.1.0.0

Constructors

ResumableC 

Fields

Instances
MonadTrans (ResumableC err) Source # 
Instance details

Defined in Control.Carrier.Resumable.Resume

Methods

lift :: Monad m => m a -> ResumableC err m a #

Monad m => Monad (ResumableC err m) Source # 
Instance details

Defined in Control.Carrier.Resumable.Resume

Methods

(>>=) :: ResumableC err m a -> (a -> ResumableC err m b) -> ResumableC err m b #

(>>) :: ResumableC err m a -> ResumableC err m b -> ResumableC err m b #

return :: a -> ResumableC err m a #

fail :: String -> ResumableC err m a #

Functor m => Functor (ResumableC err m) Source # 
Instance details

Defined in Control.Carrier.Resumable.Resume

Methods

fmap :: (a -> b) -> ResumableC err m a -> ResumableC err m b #

(<$) :: a -> ResumableC err m b -> ResumableC err m a #

MonadFix m => MonadFix (ResumableC err m) Source # 
Instance details

Defined in Control.Carrier.Resumable.Resume

Methods

mfix :: (a -> ResumableC err m a) -> ResumableC err m a #

MonadFail m => MonadFail (ResumableC err m) Source # 
Instance details

Defined in Control.Carrier.Resumable.Resume

Methods

fail :: String -> ResumableC err m a #

Applicative m => Applicative (ResumableC err m) Source # 
Instance details

Defined in Control.Carrier.Resumable.Resume

Methods

pure :: a -> ResumableC err m a #

(<*>) :: ResumableC err m (a -> b) -> ResumableC err m a -> ResumableC err m b #

liftA2 :: (a -> b -> c) -> ResumableC err m a -> ResumableC err m b -> ResumableC err m c #

(*>) :: ResumableC err m a -> ResumableC err m b -> ResumableC err m b #

(<*) :: ResumableC err m a -> ResumableC err m b -> ResumableC err m a #

MonadIO m => MonadIO (ResumableC err m) Source # 
Instance details

Defined in Control.Carrier.Resumable.Resume

Methods

liftIO :: IO a -> ResumableC err m a #

Alternative m => Alternative (ResumableC err m) Source # 
Instance details

Defined in Control.Carrier.Resumable.Resume

Methods

empty :: ResumableC err m a #

(<|>) :: ResumableC err m a -> ResumableC err m a -> ResumableC err m a #

some :: ResumableC err m a -> ResumableC err m [a] #

many :: ResumableC err m a -> ResumableC err m [a] #

(Alternative m, Monad m) => MonadPlus (ResumableC err m) Source # 
Instance details

Defined in Control.Carrier.Resumable.Resume

Methods

mzero :: ResumableC err m a #

mplus :: ResumableC err m a -> ResumableC err m a -> ResumableC err m a #

Algebra sig m => Algebra (Resumable err :+: sig) (ResumableC err m) Source # 
Instance details

Defined in Control.Carrier.Resumable.Resume

Methods

alg :: (Resumable err :+: sig) (ResumableC err m) a -> ResumableC err m a #

Resumable effect