[Haskell-cafe] a minor bug (memory leak) in ListLike package

wren ng thornton wren at freegeek.org
Wed Aug 24 07:45:13 CEST 2011


On 8/23/11 11:17 PM, bob zhang wrote:
> I think 3 < genericLength [1..] should fail, that laziness is not we want.

And it'd be more efficient to use

     lengthBound 3 (<) [1..]

where lengthBound is from list-extras:Data.List.Extras.LazyLength. The 
efficiency comes from using Int rather than a chain of pointers for lazy 
Peano numbers.

-- 
Live well,
~wren



More information about the Haskell-Cafe mailing list