[Haskell-cafe] Re: Shouldnt this be lazy too?

Aaron Denney wnoise at ofb.net
Mon Sep 24 17:54:20 EDT 2007


On 2007-09-24, Andrew Coppin <andrewcoppin at btinternet.com> wrote:
> Neil Mitchell wrote:
>> Hi
>>
>> lengthNat [1..] > 10
>>
>> Couldn't be clearer, and can be made to work perfectly. If anyone does
>> want to pick up the lazy naturals work, I can send over the code (or
>> write it yourself - its not hard!)
>>   
>
> Um... isn't a lazy natural just a list with no data, where the list 
> length encodes a number?

That's one particularly simple representation, yes.  "Lazy Unary".
One can also construct other representations that may be more efficient
in certain situations.

-- 
Aaron Denney
-><-



More information about the Haskell-Cafe mailing list