Safe Haskell | Safe-Inferred |
---|---|
Language | Haskell2010 |
Simple.TopSort
Synopsis
- type Node = Int
- type InDegGraph = HashMap Node ([Node], Int)
- topsort :: [(Node, [Node])] -> [Node]
- postOrderHM :: [Node] -> InDegGraph %1 -> Ur [Node]
- pluckSources :: [Node] -> [Node] -> InDegGraph %1 -> Ur [Node]
- findSources :: [Node] -> InDegGraph %1 -> (InDegGraph, Ur [Node])
- checkSource :: Node -> InDegGraph %1 -> (InDegGraph, Ur (Maybe Node))
- mapAccum :: (a -> b %1 -> (b, Ur c)) -> [a] -> b %1 -> (b, Ur [c])
Documentation
postOrderHM :: [Node] -> InDegGraph %1 -> Ur [Node] Source #
pluckSources :: [Node] -> [Node] -> InDegGraph %1 -> Ur [Node] Source #
findSources :: [Node] -> InDegGraph %1 -> (InDegGraph, Ur [Node]) Source #
checkSource :: Node -> InDegGraph %1 -> (InDegGraph, Ur (Maybe Node)) Source #
Check if a node is a source, and if so return it