indigo-0.1.0.0: Convenient imperative eDSL over Lorentz.
Safe HaskellNone
LanguageHaskell2010

Indigo.Backend.Var

Description

Backend of the statements to create and modify variables

Synopsis

Documentation

newVar :: IsExpr ex x => ex -> IndigoState inp (x & inp) (Var x) Source #

Create a new variable with passed expression as an initial value.

setVar :: forall a ex inp. ex :~> a => Var a -> ex -> IndigoState inp inp () Source #

Set the variable to a new value.

If a variable is a cell on the stack, we just compile passed expression and replace variable cell on stack. If a variable is decomposed, we decompose passed expression and call setVar recursively from its fields.

setField :: forall dt fname ftype ex inp. (ex :~> ftype, IsObject dt, IsObject ftype, HasField dt fname ftype) => Var dt -> Label fname -> ex -> IndigoState inp inp () Source #

Set the field (direct or indirect) of a complex object.

updateVar :: (IsExpr ey y, IsObject x) => ([y, x] :-> '[x]) -> Var x -> ey -> IndigoState inp inp () Source #

Call binary operator with constant argument to update variable in-place.