ddc-core-flow-0.4.2.1: Disciplined Disciple Compiler data flow compiler.

Safe HaskellNone
LanguageHaskell98

DDC.Core.Flow.Transform.Rates.CnfFromExp

Synopsis

Documentation

cnfOfExp :: ExpF -> Either ConversionError (Program Name Name) Source

Convert a given expression function to CNF. For this to succeed, the function must: - be in A-normal form, *except* worker functions should also be inlined - all bindings are named, not de Bruijn indices - names must be unique - no recursive bindings - no letregions

If it succeeds, it should be true that >>> expOfCnf . right . cnfOfExp = id at least semantically, if not syntactically

takeXLamFlags_safe :: Exp a n -> ([(Bool, Bind n)], Exp a n) Source

Peel the lambdas off, or leave it alone if there are none