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

Henning Thielemann lemming at henning-thielemann.de
Sun Aug 24 03:48:46 EDT 2008


On Sat, 23 Aug 2008, Gwern Branwen wrote:

>> A similar argument could be made against ``take 5 [] = []''.

sure

>> A different solution would be using Nat or Natural as arguments here ---
>> then the conversion introduces an obvious place to check for errors.
>>
>> Wolfram
>
> I've actually long wondered about this: why don't more functions use Nat where it'd make sense? It can't be because Nat is hard to define - I'd swear I've seen many definitions of Nat (if not dozens when you count all the type-level exercises which include one).

http://hackage.haskell.org/cgi-bin/hackage-scripts/package/non-negative



More information about the Libraries mailing list