
2 Aug
2007
2 Aug
'07
8:56 p.m.
On 8/2/07, David Roundy
This would be a very nice type to have (natural numbers), but is a tricky type to work with. Subtraction, for instance, wouldn't be possible as a complete function...
There is a subtraction-like operation for naturals, where a - b = 0 if a <= b. This is analogous to the way that "drop n xs" returns [] if n
= length xs, but using it in a Num instance would probably violate too many assumptions.
The desire to support naturals was the motivation for including semirings in my Num refactoring thought-experiment. http://article.gmane.org/gmane.comp.lang.haskell.cafe/15141/