Safe Haskell | None |
---|---|

Language | Haskell2010 |

Transformations of the Normalization process

- appProp :: NormRewrite
- bindNonRep :: NormRewrite
- liftNonRep :: NormRewrite
- caseLet :: NormRewrite
- caseCon :: NormRewrite
- caseCase :: NormRewrite
- inlineNonRep :: NormRewrite
- typeSpec :: NormRewrite
- nonRepSpec :: NormRewrite
- etaExpansionTL :: NormRewrite
- nonRepANF :: NormRewrite
- bindConstantVar :: NormRewrite
- constantSpec :: NormRewrite
- makeANF :: NormRewrite
- deadCode :: NormRewrite
- topLet :: NormRewrite
- recToLetRec :: NormRewrite
- inlineClosed :: NormRewrite
- inlineHO :: NormRewrite
- inlineSmall :: NormRewrite
- simpleCSE :: NormRewrite
- reduceConst :: NormRewrite

# Documentation

Propagate arguments of application inwards; except for `Lam`

where the
argument becomes let-bound.

bindNonRep :: NormRewrite Source

Inline non-recursive, non-representable let-bindings

liftNonRep :: NormRewrite Source

Lift non-representable let-bindings

Lift the let-bindings out of the subject of a Case-decomposition

Specialize a Case-decomposition (replace by the RHS of an alternative) if the subject is (an application of) a DataCon; or if there is only a single alternative that doesn't reference variables bound by the pattern.

caseCase :: NormRewrite Source

Move a Case-decomposition from the subject of a Case-decomposition to the alternatives

inlineNonRep :: NormRewrite Source

Inline function with a non-representable result if it's the subject of a Case-decomposition

typeSpec :: NormRewrite Source

Specialize functions on their type

nonRepSpec :: NormRewrite Source

Specialize functions on their non-representable argument

etaExpansionTL :: NormRewrite Source

Eta-expand top-level lambda's (DON'T use in a traversal!)

nonRepANF :: NormRewrite Source

Bring an application of a DataCon or Primitive in ANF, when the argument is is considered non-representable

bindConstantVar :: NormRewrite Source

Inline let-bindings when the RHS is either a local variable reference or is constant

constantSpec :: NormRewrite Source

Specialise functions on arguments which are constant

Turn an expression into a modified ANF-form. As opposed to standard ANF, constants do not become let-bound.

deadCode :: NormRewrite Source

Remove unused let-bindings

Ensure that top-level lambda's eventually bind a let-expression of which the body is a variable-reference.

recToLetRec :: NormRewrite Source

Turn a normalized recursive function, where the recursive calls only pass along the unchanged original arguments, into let-recursive function. This means that all recursive calls are replaced by the same variable reference as found in the body of the top-level let-expression.

inlineClosed :: NormRewrite Source

Inline nullary/closed functions

inlineHO :: NormRewrite Source

Inline a function with functional arguments

inlineSmall :: NormRewrite Source

Inline small functions

simpleCSE :: NormRewrite Source

Simplified CSE, only works on let-bindings, works from top to bottom