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

Indigo.Internal.Expr.Decompose

Description

Decompose a complex value into its fields to be used in setVar. Also functionality to generate code to deconstruct storage into primitive fields the storage consists of and to construct it back.

Synopsis

Documentation

decomposeExpr :: ComplexObjectC a => Expr a -> ExprDecomposition inp a Source #

Decompose an expression to list of its direct fields.

deepDecomposeCompose :: forall a inp. IsObject a => SomeIndigoState (a & inp) (Var a) Source #

For given element on stack, generate code which decomposes it to list of its deep non-decomposable fields. Clean up code of SomeIndigoState composes the value back.

data ExprDecomposition inp a where Source #

Datatype representing decomposition of Expr.

Constructors

ExprFields :: Rec Expr (FieldTypes a) -> ExprDecomposition inp a 
Deconstructed :: IndigoState inp (FieldTypes a ++ inp) () -> ExprDecomposition inp a 

class IsObject' (TypeDecision a) a => IsObject a Source #

Instances

Instances details
IsObject' (TypeDecision a) a => IsObject a Source # 
Instance details

Defined in Indigo.Internal.Object