imperative-edsl-0.8: 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.

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 i1, DryInterp i2) => DryInterp (i1 :+: i2 :: (Type -> Type, k) -> Type -> Type) Source # 
Instance details

Defined in Language.Embedded.Traversal

Methods

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

DryInterp C_CMD Source # 
Instance details

Defined in Language.Embedded.Imperative.CMD

Methods

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

DryInterp ControlCMD Source # 
Instance details

Defined in Language.Embedded.Imperative.CMD

Methods

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

DryInterp (FileCMD :: (Type -> Type, (Type -> Type, (Type -> Constraint, Type))) -> Type -> Type) Source # 
Instance details

Defined in Language.Embedded.Imperative.CMD

Methods

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

DryInterp (ArrCMD :: (Type -> Type, (Type -> Type, (Type -> Constraint, Type))) -> Type -> Type) Source # 
Instance details

Defined in Language.Embedded.Imperative.CMD

Methods

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

DryInterp (RefCMD :: (Type -> Type, (Type -> Type, (Type -> Constraint, Type))) -> Type -> Type) Source # 
Instance details

Defined in Language.Embedded.Imperative.CMD

Methods

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

DryInterp (ChanCMD :: (Type -> Type, (Type -> Type, (Type -> Constraint, Type))) -> Type -> Type) Source # 
Instance details

Defined in Language.Embedded.Concurrent.CMD

Methods

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

DryInterp (ThreadCMD :: (Type -> Type, (Type -> Type, (k2, Type))) -> Type -> Type) Source # 
Instance details

Defined in Language.Embedded.Concurrent.CMD

Methods

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

DryInterp (PtrCMD :: (Type -> Type, (k1, (k2, Type))) -> Type -> Type) Source # 
Instance details

Defined in Language.Embedded.Imperative.CMD

Methods

dryInterp :: MonadSupply m => PtrCMD (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