On 2006-03-24, Daniel McAllansmith <[EMAIL PROTECTED]> wrote:
> 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
-><-

_______________________________________________
Haskell-Cafe mailing list
[email protected]
http://www.haskell.org/mailman/listinfo/haskell-cafe

Reply via email to