Safe Haskell | None |
---|---|
Language | Haskell2010 |
Control.Effects1
- type family EffectMsg1 eff :: * -> *
- type family EffectRes1 eff :: * -> *
- class Monad m => MonadEffect1 eff m where
- newtype EffHandling1 eff m = EffHandling1 {
- getHandling1 :: forall a. EffectMsg1 eff a -> m (EffectRes1 eff a)
- newtype EffectHandler1 eff m a = EffectHandler1 {
- unpackEffectHandler1 :: ReaderT (EffHandling1 eff m) m a
- handleEffect1 :: Monad m => (forall a. EffectMsg1 eff a -> m (EffectRes1 eff a)) -> EffectHandler1 eff m a -> m a
Documentation
type family EffectMsg1 eff :: * -> * Source #
type family EffectRes1 eff :: * -> * Source #
class Monad m => MonadEffect1 eff m where Source #
Minimal complete definition
Methods
effect1 :: proxy eff -> EffectMsg1 eff a -> m (EffectRes1 eff a) Source #
Use the effect described by eff
.
Instances
(MonadEffect1 eff m, MonadTrans t, Monad (t m)) => MonadEffect1 eff (t m) Source # | |
Monad m => MonadEffect1 eff (EffectHandler1 eff m) Source # | |
newtype EffHandling1 eff m Source #
Constructors
EffHandling1 | |
Fields
|
newtype EffectHandler1 eff m a Source #
The EffectHandler1
is rally just a ReaderT
carrying around the function that knows how to
handle the effect.
Constructors
EffectHandler1 | |
Fields
|
Instances
MonadState s m => MonadState s (EffectHandler1 eff m) Source # | |
MonadReader s m => MonadReader s (EffectHandler1 eff m) Source # | |
MonadBaseControl IO m => MonadBaseControl IO (EffectHandler1 eff m) Source # | |
MonadBase IO m => MonadBase IO (EffectHandler1 eff m) Source # | |
Monad m => MonadEffect1 eff (EffectHandler1 eff m) Source # | |
MonadTrans (EffectHandler1 eff) Source # | |
Monad m => Monad (EffectHandler1 eff m) Source # | |
Functor m => Functor (EffectHandler1 eff m) Source # | |
Applicative m => Applicative (EffectHandler1 eff m) Source # | |
MonadRandom m => MonadRandom (EffectHandler1 eff m) Source # | |
MonadIO m => MonadIO (EffectHandler1 eff m) Source # | |
MonadThrow m => MonadThrow (EffectHandler1 eff m) Source # | |
MonadCatch m => MonadCatch (EffectHandler1 eff m) Source # | |
type StM (EffectHandler1 eff m) a Source # | |
handleEffect1 :: Monad m => (forall a. EffectMsg1 eff a -> m (EffectRes1 eff a)) -> EffectHandler1 eff m a -> m a Source #
Handle the effect described by eff
.