[Haskell-cafe] List algorithm

Jules Bean jules at jellybean.co.uk
Tue May 22 02:36:20 EDT 2007


Matthew Brecknell wrote:
> This seems to work, but presumably only because it's a boxed array, and
> the construction makes no circular references.


Yes, AIUI the boxed arrays are strict in indices but lazy in values. 
Therefore they can be used for this kind of memoization trick as long as 
you're access the elements in 'some sensible order' (that is the 
calculation dependencies are well-ordered).


More information about the Haskell-Cafe mailing list