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

Gibbon.Passes.RouteEnds

Description

Insert end witnesses in an L2 program by changing function types, and updating expressions to pass (second-class) end locations around via RetE in tail position and an extended binding form in LetE. Assumes that expressions are flattened and in ANF, and that location symbols are all unique! Failure to meet these assumptions will cause this pass to fail or possibly produce wrong output.

Synopsis

Documentation

routeEnds :: Prog2 -> PassM Prog2 Source #

Process an L2 Prog and thread through explicit end-witnesses. Requires Gensym and runs in PassM. Assumes the Prog has been flattened.