Safe Haskell | None |
---|---|
Language | Haskell2010 |
Backend of the statements to create and modify variables
Synopsis
- newVar :: IsExpr ex x => ex -> IndigoState inp (x & inp) (Var x)
- setVar :: forall a ex inp. ex :~> a => Var a -> ex -> IndigoState inp inp ()
- 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 ()
- updateVar :: (IsExpr ey y, IsObject x) => ([y, x] :-> '[x]) -> Var x -> ey -> IndigoState inp inp ()
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.