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

Safe HaskellNone
LanguageHaskell2010

Language.Embedded.Traversal

Description

Methods for traversing programs

Synopsis

Documentation

class DryInterp instr where Source #

Dry (effect-less) interpretation of an instruction. This class is like Interp without the monad parameter, so it cannot have different instances for different monads.

Minimal complete definition

dryInterp

Methods

dryInterp :: MonadSupply m => instr '(m, fs) a -> m a Source #

Dry interpretation of an instruction. This function is like interp except that it interprets in any monad that can supply fresh variables.

Instances

(DryInterp k i1, DryInterp k i2) => DryInterp k ((:+:) (* -> *, k) * i1 i2) Source # 

Methods

dryInterp :: MonadSupply m => instr ((* -> *, ((* -> *, k) :+: *) i1 i2) m fs) a -> m a Source #

DryInterp (* -> *, (* -> Constraint, *)) C_CMD Source # 

Methods

dryInterp :: MonadSupply m => instr ((* -> *, C_CMD) m fs) a -> m a Source #

DryInterp (* -> *, (* -> Constraint, *)) ControlCMD Source # 

Methods

dryInterp :: MonadSupply m => instr ((* -> *, ControlCMD) m fs) a -> m a Source #

DryInterp (* -> *, (* -> Constraint, *)) (FileCMD (* -> *)) Source # 

Methods

dryInterp :: MonadSupply m => instr ((* -> *, FileCMD (* -> *)) m fs) a -> m a Source #

DryInterp (* -> *, (* -> Constraint, *)) (ArrCMD (* -> *)) Source # 

Methods

dryInterp :: MonadSupply m => instr ((* -> *, ArrCMD (* -> *)) m fs) a -> m a Source #

DryInterp (* -> *, (* -> Constraint, *)) (RefCMD (* -> *)) Source # 

Methods

dryInterp :: MonadSupply m => instr ((* -> *, RefCMD (* -> *)) m fs) a -> m a Source #

DryInterp (* -> *, (* -> Constraint, *)) (ChanCMD (* -> *)) Source # 

Methods

dryInterp :: MonadSupply m => instr ((* -> *, ChanCMD (* -> *)) m fs) a -> m a Source #

DryInterp (* -> *, (k2, *)) (ThreadCMD k2) Source # 

Methods

dryInterp :: MonadSupply m => instr ((* -> *, ThreadCMD k2) m fs) a -> m a Source #

DryInterp (k1, (k2, *)) (PtrCMD (* -> *) k1 k2) Source # 

Methods

dryInterp :: MonadSupply m => instr ((* -> *, PtrCMD (* -> *) k1 k2) m fs) a -> m a Source #

observe_ Source #

Arguments

:: (DryInterp instr, HFunctor instr, MonadSupply m) 
=> (forall a. instr '(m, fs) a -> a -> m ())

Function for observing instructions

-> Program instr fs a 
-> m a 

Interpretation of a program as a combination of dry interpretation and effectful observation

observe Source #

Arguments

:: (DryInterp instr, HFunctor instr, MonadSupply m) 
=> (forall a. instr '(m, fs) a -> a -> m a)

Function for observing instructions

-> Program instr fs a 
-> m a 

Interpretation of a program as a combination of dry interpretation and effectful observation