2533: Generic functions that take integral arguments should work the same way as their prelude counterparts

Yitzchak Gale gale at sefer.org
Sun Aug 24 05:11:00 EDT 2008


Sean Leather wrote:
> Can you examples of both naive definitions and fast definitions of Nat? I'm
> curious.

Besides naive or fast, there is also lazy. So for example, using lazy
naturals, the expression genericLength x < genericLength y only
forces enough of x and y to determine which is longer.

Here is John Meacham's implementation:

http://www.haskell.org/pipermail/haskell-cafe/2007-October/033213.html

Regards,
Yitz


More information about the Libraries mailing list