hakaru-0.4.0: A probabilistic programming language

CopyrightCopyright (c) 2016 the Hakaru team
LicenseBSD3
MaintainerStability : experimental
PortabilityGHC-only
Safe HaskellNone
LanguageHaskell2010

Language.Hakaru.Syntax.Hoist

Description

Hoist expressions to the point where their data dependencies are met. This pass duplicates *a lot* of work and relies on a the CSE and pruning passes to cleanup the junk (most of which is trivial to do, but we don't know what is junk until after CSE has occured).

NOTE: This pass assumes globally unique variable ids, as two subterms may otherwise bind the same variable. Those variables would potentially shadow eachother if hoisted upward to a common scope.

Documentation

hoist :: ABT Term abt => abt '[] a -> abt '[] a Source #