simple-effects-0.5.0.3: A simple effect system that integrates with MTL

Safe HaskellNone
LanguageHaskell2010

Control.Effects.Early

Synopsis

Documentation

data Early a Source #

Instances

Monad m => MonadEffect (Early a) (ExceptT a m) Source # 

Methods

effect :: proxy (Early a) -> EffectMsg (Early a) -> ExceptT a m (EffectRes (Early a)) Source #

type EffectRes (Early a) Source # 
type EffectRes (Early a) = Void
type EffectMsg (Early a) Source # 
type EffectMsg (Early a) = a

earlyReturn :: forall a b m. MonadEffect (Early a) m => a -> m b Source #

Allows you to return early from a function. Make sure you handleEarly to get the actual result out

handleEarly :: Monad m => ExceptT a m a -> m a Source #

Get the result from a computation. Either the early returned one, or the regular result.