Neil Mitchell wrote:
Hi

Um... isn't a lazy natural just a list with no data, where the list
length encodes a number?

Pretty much, yes.

So I just need to write

 newtype LazyNatural = LazyNatural [()]

and then add some suitable instances. ;-)

(Woah... that's one bizzare-looking type there!)

Hey, the "length" function would then just be

 ln_length :: [x] -> LazyNatural
 ln_length = LazyNatural . map (const ())

Ooo, that's hard.

_______________________________________________
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe

Reply via email to