[Haskell-cafe] Graphical graph reduction

dainichi at gmail.com dainichi at gmail.com
Fri Feb 22 10:55:54 EST 2008


Hi Haskell-Cafe,

I'm relatively new to Haskell, but have a background with SML. One of the
things that amaze me about Haskell is lazy graph reduction, e.g. how the
graph unfolds during the evaluation of, say,

let fibs = 1 : 1 : zipWith (+) fibs (tail fibs) in take 10 fibs

Lazy lists can be simulated in SML too, but unless I do something clever
with references, I end up taking exponential time to compute the n'th
Fibonacci number.

Now to the point: Wouldn't it be great if I had a visual tool that visually
showed me the graph while the above evaluation unfolded? I could use it to
show some of my co-workers to whom laziness is a mystery, what it's all
about.

Does anybody know if such a tool exists? I'd be grateful for pointers if it
does. I very much doubt that I'm the first person who has thoughts like
this, but then again, who knows. People who really know Haskell might think
this is too trivial a task to really be worth spending time on.

If nothing similar exists, I was thinking about creating such a tool (i.e.
an interpreter with additional graph-displaying features) for a very, very
small subset/dialect of Haskell. I would probably be lazy (no pun intended)
and start right away with abstract syntax trees to avoid lexing and parsing
and such. My language of implementation would be SML, using references as
the edges of the graph.

Any ideas/comments would be welcome.

Kai
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://www.haskell.org/pipermail/haskell-cafe/attachments/20080223/4a4e249a/attachment.htm


More information about the Haskell-Cafe mailing list