gibbon-0.3: A compiler for operating on serialized data
Safe HaskellSafe-Inferred
LanguageHaskell2010

Gibbon.Passes.Flatten

Description

Put the program in A-normal form where only varrefs and literals are allowed in operand position.

Synopsis

Documentation

flattenL1 :: Prog1 -> PassM Prog1 Source #

Flatten ensures that function operands are "trivial".

In the process, it also lifts lets out of case scrutinees, if conditions, and tuple operands.

Note that it does not require tail expressions to be trivial. For example, it allows AppE and PrimAppE in the body of a let-expression.

Orphan instances

FlattenDeps e l d => Flattenable (PreExp e l d) Source # 
Instance details

Methods

gFlattenExp :: DDefs (TyOf (PreExp e l d)) -> Env2 (TyOf (PreExp e l d)) -> PreExp e l d -> PassM (PreExp e l d) Source #

gFlattenGatherBinds :: DDefs (TyOf (PreExp e l d)) -> Env2 (TyOf (PreExp e l d)) -> PreExp e l d -> PassM ([Binds (PreExp e l d)], PreExp e l d) Source #