3 Aug
2007
3 Aug
'07
8:56 a.m.
On 8/2/07, David Roundy <droundy@darcs.net> wrote:
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/>