[Haskell-cafe] Shouldnt this be lazy too?

Neil Mitchell ndmitchell at gmail.com
Mon Sep 24 12:24:04 EDT 2007


Hi Vimal,

> I was surprised to find out that the following piece of code:
>
> > length [1..] > 10
>
> isnt lazily evaluated!

The problem is that Int and Integer are both eager. It is possible to
write a lazy peano number based data type, but I'm not aware of anyone
who has - I have half the code (in joint work with Matt Naylor and
Greg Manning) but none of us have taken the time to finish it off
properly.

For details about why we should have lazy naturals read
http://citeseer.ist.psu.edu/45669.html - Colin Runciman, What About
the Natural Numbers (1989)

Thanks

Neil


More information about the Haskell-Cafe mailing list