
23 Mar
2006
23 Mar
'06
8:14 p.m.
On 2006-03-24, Daniel McAllansmith
Unless I've missed it, there is no typeclass for positive integers in GHC. Is there any particular reason it doesn't exist?
The number of useable operations is small, and checks for leaving the domain would have to be done all the time. It basically doesn't buy anything.
Also, it seems Word would be a far better type in the likes of (!!), length, etc. Is it just tradition that resulted in the use of Int?
No. I'd like to be able to get the differences in length both positive and negative, for example. (This could be fixed by making (+) and (-) instance of an MPTC, though, as additive torsors.) -- Aaron Denney -><-