imperative-edsl-0.8.2: 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 constants and named variables

Associated Types

type FreePred exp :: * -> Constraint Source #

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

Methods

constExp :: FreePred exp a => a -> exp a Source #

Inject a constant value

varExp :: FreePred exp a => VarId -> exp a Source #

Inject a named variable

Instances

Instances details
FreeExp IO Source # 
Instance details

Defined in Language.Embedded.Concurrent.CMD

Associated Types

type FreePred IO :: Type -> Constraint Source #

Methods

constExp :: FreePred IO a => a -> IO a Source #

varExp :: FreePred IO a => VarId -> IO a Source #

FreeExp CExp Source # 
Instance details

Defined in Language.Embedded.CExp

Associated Types

type FreePred CExp :: Type -> Constraint Source #

Methods

constExp :: FreePred CExp a => a -> CExp a Source #

varExp :: FreePred CExp a => VarId -> CExp a Source #

data Val a Source #

Value

Constructors

ValComp VarId

Symbolic value

ValRun a

Concrete value

Instances

Instances details
ToIdent (Val a) Source # 
Instance details

Defined in Language.Embedded.Expression

Methods

toIdent :: Val a -> SrcLoc -> Id #

valToExp :: (FreeExp exp, FreePred exp a) => 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

Instances details
EvalExp CExp Source # 
Instance details

Defined in Language.Embedded.CExp

Methods

evalExp :: CExp a -> a Source #