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

Indigo.FromLorentz

Description

Generation of functions that convert Lorentz code to Indigo

Synopsis

Documentation

genFromLorentzFunN :: Int -> Q [Dec] Source #

Generates all of the fromLorentzFunN (both with and without return value) from 1 to the given n

fromLorentzFunN :: Int -> Bool -> Q [Dec] Source #

Generates a function that converts a Lorentz expression to an Indigo one.

The first parameter is the number of elements that the Lorentz code consumes from the stack, as well as the number of Indigo IsExpr values.

The second parameter is to establish if there is a return value or not, as well as the name of the function.

Examples:

  • fromLorentzFunN 1 False produces:
fromLorentzFun1Void :: IsExpr ex a => a & s :-> s -> ex -> IndigoM s s ()
  • fromLorentzFunN 2 True produces:
fromLorentzFun2
  :: (KnownValue ret, IsExpr ex1 a, IsExpr ex2 b)
  => a & b & s :-> ret & s
  -> ex1 -> ex2 -> IndigoM s (ret & s) (Var ret)