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

Indigo.Internal.Expr.Compilation

Description

Expr compilation

Synopsis

Documentation

compileExpr :: forall a inp. Expr a -> IndigoState inp (a & inp) () Source #

compileToExpr :: ToExpr a => a -> IndigoState inp (ExprType a & inp) () Source #

data ObjManipulationRes inp a where Source #

ObjManipulationRes represents a postponed compilation of ObjectManipulation datatype. When ObjectManipulation is being compiled we are trying to put off the generation of code for work with an object because we can just go to a deeper field without its "materialization" onto stack.

Constructors

StillObject :: ObjectExpr a -> ObjManipulationRes inp a 
OnStack :: IndigoState inp (a & inp) () -> ObjManipulationRes inp a 

runObjectManipulation :: ObjectManipulation x -> ObjManipulationRes inp x Source #

This function might look cumbersome but it basically either goes deeper to an inner field or generates Lorentz code.

nullaryOp :: KnownValue res => (inp :-> (res ': inp)) -> IndigoState inp (res ': inp) () Source #

unaryOp :: forall n ex res inp. (IsExpr ex n, KnownValue res) => ex -> ((n & inp) :-> (res & inp)) -> IndigoState inp (res & inp) () Source #

binaryOp :: forall n m ex1 ex2 res inp. (AreExprs ex1 ex2 n m, KnownValue res) => ex1 -> ex2 -> ((n & (m & inp)) :-> (res & inp)) -> IndigoState inp (res & inp) () Source #

ternaryOp :: forall n m l ex1 ex2 ex3 res inp. (AreExprs ex1 ex2 n m, IsExpr ex3 l, KnownValue res) => ex1 -> ex2 -> ex3 -> ((n & (m & (l & inp))) :-> (res & inp)) -> IndigoState inp (res & inp) () Source #

nullaryOpFlat :: (inp :-> inp) -> IndigoState inp inp () Source #

unaryOpFlat :: forall n ex inp. IsExpr ex n => ex -> ((n & inp) :-> inp) -> IndigoState inp inp () Source #

binaryOpFlat :: forall n m ex1 ex2 inp. AreExprs ex1 ex2 n m => ex1 -> ex2 -> ((n & (m & inp)) :-> inp) -> IndigoState inp inp () Source #

ternaryOpFlat :: forall n m l ex1 ex2 ex3 inp. (AreExprs ex1 ex2 n m, IsExpr ex3 l) => ex1 -> ex2 -> ex3 -> ((n & (m & (l & inp))) :-> inp) -> IndigoState inp inp () Source #