[Haskell-cafe] Traversing a graph in STM

Chris Kuklewicz haskell at list.mightyreason.com
Wed Sep 13 03:48:35 EDT 2006

Einar Karttunen wrote:
> Hello
> Is there an elegant way of traversing a directed graph in STM?
> type Node  nt et = TVar (NodeT nt et)
> type Edge  et    = TVar et
> data NodeT nt et = NodeT nt [(Node nt et, Edge et)]
> type MyGraph = Node String Int
> When implementing a simple depth first search we need a way to
> mark nodes (= TVars) as visited. In addition multiple concurrent
> searches should be possible.

And the concurrent searches are isolated from each other?  Or are you performing 
a single search using many threads?

> Is it possible to avoid passing around an explicit Set of visited
> nodes? And is there a better way of getting TVar identity than
> StableNames?
> - Einar Karttunen
> _______________________________________________
> Haskell-Cafe mailing list
> Haskell-Cafe at haskell.org
> http://www.haskell.org/mailman/listinfo/haskell-cafe

More information about the Haskell-Cafe mailing list