demarcate-0.1.0: Demarcating transformed monad.

Portabilityghc
Stabilityexperimental
Maintainernickolay.kudasov@gmail.com
Safe HaskellTrustworthy

Control.Monad.Trans.Demarcate.Internal

Description

Internals of the Demarcate monad transformer.

Synopsis

Documentation

data DemarcateF t m next Source

Demarcate functor.

Constructors

forall a . DemarcateMonad (m a) (a -> next)

Unlifted monadic computation.

forall a . DemarcateTrans (t m a) (a -> next)

Transformed monadic computation.

Instances

newtype Demarcate t m a Source

Demarcate monad transformer.

Constructors

Demarcate 

Fields

unDemarcate :: Free (DemarcateF t m) a
 

demarcateM :: m a -> Demarcate t m aSource

Lift pure monadic computation into Demarcate t m a

demarcateT :: t m a -> Demarcate t m aSource

Lift transformed monadic computation into Demarcate t m a

execDemarcate :: (Monad (t m), Monad m, MonadTrans t) => Demarcate t m a -> t m aSource

Execute demarcated computation.

hoistDemarcateT :: (forall b. t m b -> t' m b) -> Demarcate t m a -> Demarcate t' m aSource

Subsitute monad transformer.

transformDemarcateM :: (forall b. m b -> Demarcate t m b) -> Demarcate t m a -> Demarcate t m aSource

Substitute monad computations with demarcated.

transformDemarcateFree :: Functor f => (forall b. f (Demarcate t (Free f) b) -> Demarcate t (Free f) b) -> Demarcate t (Free f) a -> Demarcate t (Free f) aSource

Substitute free monad actions with demarcated monad computations.

wrapT :: (Functor f, MonadFree f m, MonadTrans t, Monad (t m)) => f (t m a) -> t m aSource

Helper function (useful with transformDemarcateFree). I believe it should be somewhere in Control.Monad.Free