graph-visit-0.1.0.2: Graph walk abstraction

Safe HaskellNone

Data.Graph.GraphVisit

Contents

Description

This module provides a graph visiting abstraction

Synopsis

Graph visiting

graphVisitMSource

Arguments

:: (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.

graphVisitSource

Arguments

:: 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

Result