Safe Haskell | None |
---|

This module provides a graph visiting abstraction

- graphVisitM :: (Ord node, Monad m) => (thr -> graph -> node -> (thr, Set node)) -> graph -> StateT (GraphVisitState node thr) m ()
- graphVisit :: Ord node => (thr -> graph -> node -> (thr, Set node)) -> Set node -> graph -> thr -> (thr, Set node)

# Graph visiting

:: (Ord node, Monad m) | |

=> (thr -> graph -> node -> (thr, Set node)) | fun: visit node, get new thr and nodes to visit next |

-> graph | graph over which we visit |

-> StateT (GraphVisitState node thr) m () |

Abstract graph visit, over arbitrary structures, using state holding visited nodes (also acting als start) and an accumulator `thr`

.
All is done in strict StateT.