Safe Haskell | None |
---|---|
Language | Haskell2010 |
Control.Effects1
- type family EffectMsg1 eff :: * -> *
- type family EffectRes1 eff :: * -> *
- type family EffectCon1 eff a :: Constraint
- class Monad m => MonadEffect1 eff m where
- newtype EffHandling1 eff m = EffHandling1 {
- getHandling1 :: forall a. EffectCon1 eff a => EffectMsg1 eff a -> m (EffectRes1 eff a)
- newtype EffectHandler1 eff m a = EffectHandler1 {
- unpackEffectHandler1 :: ReaderT (EffHandling1 eff m) m a
- handleEffect1 :: (forall a. EffectCon1 eff a => EffectMsg1 eff a -> m (EffectRes1 eff a)) -> EffectHandler1 eff m b -> m b
Documentation
type family EffectMsg1 eff :: * -> * Source #
Instances
type EffectMsg1 NonDeterministic Source # | |
type EffectMsg1 (State s) Source # | |
type family EffectRes1 eff :: * -> * Source #
Instances
type EffectRes1 NonDeterministic Source # | |
type EffectRes1 (State s) Source # | |
type family EffectCon1 eff a :: Constraint Source #
Instances
type EffectCon1 NonDeterministic a Source # | |
type EffectCon1 (State s) a Source # | |
class Monad m => MonadEffect1 eff m where Source #
Minimal complete definition
Methods
effect1 :: EffectCon1 eff a => 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 NonDeterministic (ListT m) Source # | |
Monad m => MonadEffect1 eff (EffectHandler1 eff m) Source # | |
Monad m => MonadEffect1 (State s) (StateT s m) Source # | |
newtype EffHandling1 eff m Source #
Constructors
EffHandling1 | |
Fields
|
newtype EffectHandler1 eff m a Source #
The EffectHandler1
is really just a ReaderT
carrying around the function that knows how to
handle the effect.
Constructors
EffectHandler1 | |
Fields
|
Instances
handleEffect1 :: (forall a. EffectCon1 eff a => EffectMsg1 eff a -> m (EffectRes1 eff a)) -> EffectHandler1 eff m b -> m b Source #
Handle the effect described by eff
.