[Haskell-cafe] Formalizing lazy lists?

Lennart Augustsson lennart at augustsson.net
Fri Nov 18 14:34:21 EST 2005


How about:

nil = \ n c . n
cons x xs = \ n c . c x xs

zero = \ z s . z
suc n = \ z s . s n

listFromZero = Y ( \ from n . cons n (from (suc n))) zero

(Untested, so I might have some mistake.)

	-- Lennart

Greg Woodhouse wrote:
> 
> --- Lennart Augustsson <lennart at augustsson.net> wrote:
> 
> 
>>What do you mean by represent?
>>It's easy enough to write down the lambda term that is the
>>encoding of [0..].
>>
>>	-- Lennart
>>
> 
> 
> You mean like \x -> x ? If I apply it to the Church numeral i, I get i
> in return.  But that hardly seems satisifying because infinite lists
> seem to be a wholly different type of object. 
> 
> 
> ===
> Gregory Woodhouse  <gregory.woodhouse at sbcglobal.net>
> 
> 
> "Interaction is the mind-body problem of computing."
> 
> --Philip Wadler
> 
> 
> 
> 
> 
> 
> 
> 
> 
> 
> 
> _______________________________________________
> Haskell-Cafe mailing list
> Haskell-Cafe at haskell.org
> http://www.haskell.org/mailman/listinfo/haskell-cafe
> 



More information about the Haskell-Cafe mailing list