[Haskell-cafe] function result caching

Tomasz Zielonka tomasz.zielonka at gmail.com
Fri Oct 13 04:05:22 EDT 2006


On Thu, Oct 12, 2006 at 08:40:44PM -0700, John Meacham wrote:
> it is too bad IntSet and IntMap are strict in their subtrees, it would
> have been nice to provide things like
> 
> out of curiosity, why are IntMap and IntSet strict in their subtrees.

I guess the reason is balancing. I can't think of any way of balancing a
lazy tree that wouldn't break abstraction.

Perhaps I would be possible to use some trick to rebalance an existing
tree to account for what's currently evaluated. But it could be very
tricky to get it right and it would certainly go beyond Haskell 98.

Best regards
Tomasz


More information about the Haskell-Cafe mailing list