
24 Aug
2008
24 Aug
'08
7:48 a.m.
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