sequent-core-0.3: Alternative Core language for GHC plugins
Safe HaskellNone



Translation between Sequent Core and native GHC Core.



The translations to and from Sequent Core are not guaranteed to be perfect inverses. However, any differences between e and commandToCoreExpr (fromCoreExpr e) should be operationally insignificant, such as a let floating out from a function being applied. A more precise characterization of the indended invariants of these functions would entail some sort of bisimulation, but it should suffice to know that the translations are "faithful enough."

fromCoreExpr :: CoreExpr -> SeqCoreCommand Source

Translates a Core expression into Sequent Core.

fromCoreBind :: CoreBind -> SeqCoreBind Source

Translates a Core binding into Sequent Core.

fromCoreBinds :: [CoreBind] -> [SeqCoreBind] Source

Translates a list of Core bindings into Sequent Core.

fromCoreAlt :: CoreAlt -> SeqCoreAlt Source

Translates a Core case alternative into Sequent Core.

commandToCoreExpr :: SeqCoreCommand -> CoreExpr Source

Translates a command into Core.

valueToCoreExpr :: SeqCoreValue -> CoreExpr Source

Translates a value into Core.

contToCoreExpr :: SeqCoreCont -> CoreExpr -> CoreExpr Source

Translates a continuation into a function that will wrap a Core expression with a fragment of context (an argument to apply to, a case expression to run, etc.).

bindToCore :: SeqCoreBind -> CoreBind Source

Translates a binding into Core.

bindsToCore :: [SeqCoreBind] -> [CoreBind] Source

Translates a list of bindings into Core.

altToCore :: SeqCoreAlt -> CoreAlt Source

Translates a case alternative into Core.