
22 Mar
2011
22 Mar
'11
3:45 p.m.
Andy Gill uses a monad in his Dot library to allow graphs to have references as they are built. It's a pattern I like a lot and has been very useful for my graphics kit Wumpus. That said, while it's a good technique for graphs, its use is more equivocal for trees where nesting is more prominent. I use a reference monad for tree building/drawing at the moment (references are essential) but I'd switch to a technique that is better with nesting if I could think of one. At the moment the Tree EDSL doesn't use references, so I'd "third" the notion that the code would be simpler if it was pure.