Safe Haskell | None |
---|
Dvda.Algorithm.FunGraph
Documentation
toFunGraph :: (Functor f, Foldable f, Traversable g) => f (Expr a) -> g (Expr a) -> IO (FunGraph f g a)Source
Take inputs and outputs and traverse the outputs reifying all expressions and creating a hashmap of StableNames. Once the hashmap is created, lookup the provided inputs and return a FunGraph which contains an expression graph, input/output indices, and other useful functions. StableNames may be non-deterministic so this function may return graphs with greater or fewer CSE's eliminated. If CSE is then performed on the graph, the result is deterministic.