monad-skeleton-0.1.2.2: An undead monad

Safe HaskellTrustworthy
LanguageHaskell2010

Control.Monad.Skeleton

Synopsis

Documentation

data MonadView t m x where Source

Constructors

Return :: a -> MonadView t m a 
(:>>=) :: t a -> (a -> m b) -> MonadView t m b infixl 1 

Instances

hoistMV :: (forall x. s x -> t x) -> (m a -> n a) -> MonadView s m a -> MonadView t n a Source

iterMV :: Monad m => (t a -> MonadView m t a) -> t a -> m a Source

newtype Skeleton t a Source

Skeleton t is a monadic skeleton (operational monad) made out of t. Skeletons can be fleshed out by getting transformed to other monads. The implementation is based on Reflection without Remorse so it provides efficient (>>=) and debone, monadic reflection.

Constructors

Skeleton 

Fields

unSkeleton :: Spine t (Skeleton t) a
 

bone :: t a -> Skeleton t a Source

A skeleton that has only one bone.

debone :: Skeleton t a -> MonadView t (Skeleton t) a Source

Pick a bone from a Skeleton.

unbone :: Skeleton t a -> MonadView t (Skeleton t) a Source

Uncommon synonym for debone.

boned :: MonadView t (Skeleton t) a -> Skeleton t a Source

Re-add a bone.

hoistSkeleton :: forall s t a. (forall x. s x -> t x) -> Skeleton s a -> Skeleton t a Source

Lift a transformation between bones into transformation between skeletons.