Safe Haskell | Safe |
---|---|
Language | Haskell2010 |
A control structure used to combine heterogenous types with delayed effects.
- class MonadShade m where
- data ShadeT m b
- type Shade = ShadeT Identity
- shade :: MonadShade m => c a -> (a -> b) -> m c b
- hide :: MonadShade m => c a -> m c a
- shadow :: Functor m => ShadeT m b -> m b
- transfer :: (MonadShade m, MonadShade m) => (forall a. c0 a -> c1 a) -> m c0 t -> m c1 t
Documentation
class MonadShade m where Source #
shade :: c a -> (a -> b) -> m c b Source #
Insert a contextual value and its projection into a shade.
transfer :: MonadShade m => (forall a. c0 a -> c1 a) -> m c0 t -> m c1 t Source #
Changed the context of a hidden value. The first argument must be universally quantified since no assumptions may be made as to what value is stored inside the shade.
A shade consists of a hidden value and an image of that value. The hidden values are stored in a context and cannot be accessed directly.
MonadTrans ShadeT Source # | |
MonadShade ShadeT Source # | |
MonadError e m => MonadError e (ShadeT m) Source # | |
MonadReader s m => MonadReader s (ShadeT m) Source # | |
MonadState s m => MonadState s (ShadeT m) Source # | |
MonadWriter s m => MonadWriter s (ShadeT m) Source # | |
Monad m => Monad (ShadeT m) Source # |
|
Functor (ShadeT m) Source # |
|
Applicative m => Applicative (ShadeT m) Source # |
|
Monad m => MonadZip (ShadeT m) Source # | |
MonadIO m => MonadIO (ShadeT m) Source # | |
Alternative m => Alternative (ShadeT m) Source # | |
(Applicative m, Monoid b) => Monoid (ShadeT m b) Source # |
|
shade :: MonadShade m => c a -> (a -> b) -> m c b Source #
Insert a contextual value and its projection into a shade.
hide :: MonadShade m => c a -> m c a Source #
Hide a boxed value inside a shade with the identity as projection.
transfer :: (MonadShade m, MonadShade m) => (forall a. c0 a -> c1 a) -> m c0 t -> m c1 t Source #
Changed the context of a hidden value. The first argument must be universally quantified since no assumptions may be made as to what value is stored inside the shade.