Safe Haskell | None |
---|
- type Graph = Map Name [Edge]
- type Edge = (Name, Bool)
- graphOfBinds :: [(Name, ExpF)] -> [Name] -> Graph
- graphTopoOrder :: Graph -> [Name]
- mergeWeights :: Graph -> Map Name Int -> Graph
- traversal :: Graph -> (Edge -> Name -> Int) -> Map Name Int
- invertMap :: (Ord k, Ord v) => Map k v -> Map v [k]
- mlookup :: Ord k => String -> Map k v -> k -> v
Documentation
type Edge = (Name, Bool)Source
Graph for function Each node is a binding, edges are dependencies, and the bool is whether the node's output can be fused or contracted. For example, filter and map dependencies can be contracted, but a fold cannot as it must consume the entire stream before producing output.
graphTopoOrder :: Graph -> [Name]Source
Find topological ordering of DAG Does not check for cycles - really must be a DAG!