Safe Haskell | None |
---|
Monadic constructs
This module is based on the paper Generic Monadic Constructs for Embedded Languages (Persson et al., IFL 2011 http://www.cse.chalmers.se/~emax/documents/persson2011generic.pdf).
- newtype Mon dom m a where
- desugarMonad :: (IsHODomain dom Typeable pVar, InjectC (MONAD m) dom (m a), Monad m, Typeable1 m, Typeable a) => Mon dom m (ASTF dom a) -> ASTF dom (m a)
- sugarMonad :: (IsHODomain dom Typeable pVar, Monad m, Typeable1 m, Typeable a, pVar a) => ASTF dom (m a) -> Mon dom m (ASTF dom a)
Documentation
newtype Mon dom m a whereSource
User interface to embedded monadic programs
Mon :: (forall r. (Monad m, Typeable r, InjectC (MONAD m) dom (m r)) => Cont (ASTF dom (m r)) a) -> Mon dom m a | |
Monad m => Monad (Mon dom m) | |
Functor (Mon dom m) | |
(Monad m, Applicative m) => Applicative (Mon dom m) | |
(Syntactic a, ~ (* -> *) (Domain a) dom, IsHODomain dom Typeable pVar, InjectC (MONAD m) dom (m (Internal a)), Monad m, Typeable1 m, Typeable (Internal a), pVar (Internal a)) => Syntactic (Mon dom m a) |
desugarMonad :: (IsHODomain dom Typeable pVar, InjectC (MONAD m) dom (m a), Monad m, Typeable1 m, Typeable a) => Mon dom m (ASTF dom a) -> ASTF dom (m a)Source
One-layer desugaring of monadic actions
sugarMonad :: (IsHODomain dom Typeable pVar, Monad m, Typeable1 m, Typeable a, pVar a) => ASTF dom (m a) -> Mon dom m (ASTF dom a)Source
One-layer sugaring of monadic actions