syntactic-1.11: Generic abstract syntax, and utilities for embedded languages

Safe HaskellNone

Language.Syntactic.Frontend.Monad

Description

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).

Synopsis

Documentation

newtype Mon dom m a whereSource

User interface to embedded monadic programs

Constructors

Mon :: (forall r. (Monad m, Typeable r, InjectC (MONAD m) dom (m r)) => Cont (ASTF dom (m r)) a) -> Mon dom m a 

Fields

unMon :: forall r. (Monad m, Typeable r, InjectC (MONAD m) dom (m r)) => Cont (ASTF dom (m r)) a
 

Instances

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