imperative-edsl-0.5: Deep embedding of imperative programs with code generation

Safe HaskellNone
LanguageHaskell2010

Language.Embedded.Expression

Description

Interface to pure expressions

Synopsis

Documentation

type VarId = String Source

Variable identifier

class FreeExp exp where Source

Expressions that support injection of values and named variables

Associated Types

type VarPred exp :: * -> Constraint Source

Constraint on the types of values and variables in an expression language

Methods

valExp :: VarPred exp a => a -> exp a Source

Construct a value expression

varExp :: VarPred exp a => VarId -> exp a Source

Construct a named variable expression

Instances

data Val a Source

Value

Constructors

ValComp VarId

Symbolic value

ValEval a

Concrete value

Instances

valToExp :: (VarPred exp a, FreeExp exp) => Val a -> exp a Source

Convert a value to an expression

class FreeExp exp => EvalExp exp where Source

Expressions that support evaluation

Methods

evalExp :: exp a -> a Source

Evaluation of a closed expression

Instances