Safe Haskell | None |
---|---|
Language | Haskell2010 |
Transactionnal graph
- deepFirst :: (Monad m, Ord a) => (a -> m ()) -> (a -> m ()) -> (a -> m [a]) -> [a] -> m ()
- breadthFirst :: (Monad m, Ord a) => (a -> m Bool) -> (a -> m [a]) -> [a] -> m ()
- data TNode a r = TNode {
- nodeValue :: a
- nodeEdgeIn :: TList (r, TNode a r)
- nodeEdgeOut :: TList (r, TNode a r)
- singleton :: a -> STM (TNode a r)
- linkTo :: TNode a r -> r -> TNode a r -> STM ()
Documentation
deepFirst :: (Monad m, Ord a) => (a -> m ()) -> (a -> m ()) -> (a -> m [a]) -> [a] -> m () Source #
Deep-first graph traversal
before is executed when the node is entered after is executed when the node is leaved children gets node's children
breadthFirst :: (Monad m, Ord a) => (a -> m Bool) -> (a -> m [a]) -> [a] -> m () Source #
Breadth-first graph traversal
visit is executed when the node is entered. If False is returned, the traversal ends children gets node's children
A node contains a value and two lists of incoming/outgoing edges
TNode | |
|