Safe Haskell | None |
---|

This module provides a graph visiting abstraction

# Graph visiting

:: (Ord node, Monad m) | |

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

-> Set node | root/start |

-> graph | graph over which we visit |

-> thr | the accumulator, threaded as state |

-> m (thr, Set node) | yield accum and visited |

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

.

:: Ord node | |

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

-> Set node | root/start |

-> graph | graph over which we visit |

-> thr | the accumulator, threaded as state |

-> (thr, Set node) | yield accum and visited |

Abstract graph visit, running graphVisitM