The one in the numbers package is not quite as clever as John's; it's the naïve version of lazy naturals.<br><br><div><span class="gmail_quote">On 10/17/07, <b class="gmail_sendername">Stuart Cook</b> <<a href="mailto:scook0@gmail.com" target="_blank" onclick="return top.js.OpenExtLink(window,event,this)">
scook0@gmail.com</a>> wrote:</span><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">On 10/17/07, John Meacham <<a href="mailto:john@repetae.net" target="_blank" onclick="return top.js.OpenExtLink(window,event,this)">
john@repetae.net</a>> wrote:<br>> if anyone is interested, Although I bet this has been implemented a<br>> hundred times over, I have attached my lazy naturals module below just<br>> for larks. It is quite efficient as such things go and very lazy. for
<br>> instance (genericLength xs > 5) will only evaluate up to the 5th element<br>> of the list before returning a result. and ((1 `div` 0) > 17) is true,<br>> not bottom.<br><br>> If anyone wants me to clean this up and package it as a real module, I
<br>> would be happy to do so.<br><br>It looks like there's already a lazy-natural type in the "numbers"<br>package on Hackage, but not having used it I have no idea what it's<br>like.<br><br><a href="http://hackage.haskell.org/cgi-bin/hackage-scripts/package/numbers-2007.9.25" target="_blank" onclick="return top.js.OpenExtLink(window,event,this)">
http://hackage.haskell.org/cgi-bin/hackage-scripts/package/numbers-2007.9.25</a><br><a href="http://tinyurl.com/2pmthz" target="_blank" onclick="return top.js.OpenExtLink(window,event,this)">http://tinyurl.com/2pmthz</a>
<br><br><br>Stuart<br>_______________________________________________<br>
Haskell-Cafe mailing list<br><a href="mailto:Haskell-Cafe@haskell.org" target="_blank" onclick="return top.js.OpenExtLink(window,event,this)">Haskell-Cafe@haskell.org</a><br><a href="http://www.haskell.org/mailman/listinfo/haskell-cafe" target="_blank" onclick="return top.js.OpenExtLink(window,event,this)">
http://www.haskell.org/mailman/listinfo/haskell-cafe</a>
<br></blockquote></div><br>