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

Safe HaskellNone
LanguageHaskell2010

Language.Syntactic.Constructs.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

data MONAD m sig where Source #

Constructors

Return :: MONAD m (a :-> Full (m a)) 
Bind :: MONAD m (m a :-> ((a -> m b) :-> Full (m b))) 
Then :: MONAD m (m a :-> (m b :-> Full (m b))) 
When :: MONAD m (Bool :-> (m () :-> Full (m ()))) 
Instances
Monad m => Semantic (MONAD m) Source # 
Instance details

Defined in Language.Syntactic.Constructs.Monad

Methods

semantics :: MONAD m a -> Semantics a Source #

Monad m => StringTree (MONAD m) Source # 
Instance details

Defined in Language.Syntactic.Constructs.Monad

Monad m => Render (MONAD m) Source # 
Instance details

Defined in Language.Syntactic.Constructs.Monad

Methods

renderSym :: MONAD m sig -> String Source #

renderArgs :: [String] -> MONAD m sig -> String Source #

Monad m => Eval (MONAD m) Source # 
Instance details

Defined in Language.Syntactic.Constructs.Monad

Methods

evaluate :: MONAD m a -> Denotation a Source #

Monad m => Equality (MONAD m) Source # 
Instance details

Defined in Language.Syntactic.Constructs.Monad

Methods

equal :: MONAD m a -> MONAD m b -> Bool Source #

exprHash :: MONAD m a -> Hash Source #

Constrained (MONAD m) Source # 
Instance details

Defined in Language.Syntactic.Constructs.Monad

Associated Types

type Sat (MONAD m) :: * -> Constraint Source #

Methods

exprDict :: MONAD m a -> Dict (Sat (MONAD m) (DenResult a)) Source #

Monad m => EvalBind (MONAD m) Source # 
Instance details

Defined in Language.Syntactic.Constructs.Binding

Methods

evalBindSym :: (EvalBind dom, ConstrainedBy dom Typeable, Typeable (DenResult sig)) => MONAD m sig -> Args (AST dom) sig -> Reader [(VarId, Dynamic)] (DenResult sig) Source #

(AlphaEq dom dom dom env, Monad m) => AlphaEq (MONAD m) (MONAD m) dom env Source # 
Instance details

Defined in Language.Syntactic.Constructs.Binding

Methods

alphaEqSym :: MONAD m a -> Args (AST dom) a -> MONAD m b -> Args (AST dom) b -> Reader env Bool Source #

type Sat (MONAD m) Source # 
Instance details

Defined in Language.Syntactic.Constructs.Monad

type Sat (MONAD m) = Top

prjMonad :: Project (MONAD m) sup => P m -> sup sig -> Maybe (MONAD m sig) Source #

Projection with explicit monad type