
2008/2/22
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.
Rather than spending time on a project specifically to do this, it seems like a great addition to GHCi's still mostly theoretical debugger. I'll understand if you don't want to take on such a project right now, though. I'm not aware of any program that does exactly what you're asking for, but I'm attaching a lambdabot interaction for your reading pleasure. I believe it will speak for itself. < Baughn> > let fibs = 1 : 1 : zipWith (+) fibs (tail fibs) in fibs :: [Expr] < lambdabot> [1,1,1 + 1,1 + (1 + 1),1 + 1 + (1 + (1 + 1)),1 + (1 + 1) + (1 + 1 + (1 + (1 ... 1 -- In a demon-haunted world, science is a candle in the dark http://dresdencodak.com/