License | BSD-3-Clause |
---|---|
Maintainer | Jamie Willis |
Stability | experimental |
Safe Haskell | None |
Language | Haskell2010 |
This module contains Lam
, which is a defunctionalised lambda calculus.
This serves as a more easy to work with form of defunctionalisation moving
into the backend and machine where it is no longer necessary to inspect function
values. It permits for the generation of efficient terms, with some inspection
of values.
Since: 1.0.1.0
Documentation
normaliseGen :: Lam a -> Code a Source #
Generates Haskell code that represents a Lam
value, but normalising it first to ensure the
term is minimal.
Since: 1.0.1.0
normalise :: Lam a -> Lam a Source #
Optimises a Lam
expression, reducing it until the outmost lambda, let, or if statement.
Since: 1.0.1.0
Defunctionalised lambda calculus in HOAS form. Supports basic inspection of values, but not functions.
Since: 1.0.1.0
Abs :: (Lam a -> Lam b) -> Lam (a -> b) | Function abstraction. |
App :: Lam (a -> b) -> Lam a -> Lam b | Function application. |
Var :: Bool -> Code a -> Lam a | Variable. The boolean represents whether it is "simple" or "complex", i.e. the size of the term. |
If :: Lam Bool -> Lam a -> Lam a -> Lam a | Conditional expression. |
Let :: Lam a -> (Lam a -> Lam b) -> Lam b | Let-binding. |
T :: Lam Bool | Value representing true. |
F :: Lam Bool | Value representing false. |