Re: Are zippers the right choice for "sequence-like" trees?

2014-06-05 Thread Paul Butcher
Thanks Jason - that’s helpful. -- paul.butcher->msgCount++ Silverstone, Brands Hatch, Donington Park... Who says I have a one track mind? http://www.paulbutcher.com/ LinkedIn: http://www.linkedin.com/in/paulbutcher Skype: paulrabutcher Author of Seven Concurrency Models in Seven Weeks: When Thr

Re: Are zippers the right choice for "sequence-like" trees?

2014-06-04 Thread Jason Felice
In general, I've found that zippers make complicated edits super-easy, while a recursive phrasing of the same algorithm - if it exists and isn't super complicated to write - performs better and gives more control over structural sharing. I might prove out an algorithm with zippers, but when the pe

Are zippers the right choice for "sequence-like" trees?

2014-06-04 Thread Paul Butcher
I am working with “sequence like” trees - by which I mean that they’re very broad (typically the root node will have several thousand children) and shallow (no more than 2 levels deep). I’m often dealing with a degenerate tree that’s really just a sequence (all the nodes in the tree are children