Why aren't classes like "Num" levity polymorphic?

Clinton Mead <[email protected]> Tue, 10 May 2022 01:26:52 +1000
Newsgroups gmane.comp.lang.haskell.glasgow.user
Message-ID <CAFDVgwF7usf9L8EOEq0=GSA-YvnX2GQrNja1YDjz=PrnnmOYsw@mail.gmail.com>
Hi All

It seems to me to be a free win just to replace:

`class Num a where`

with

`class Num (a :: (r :: RuntimeRep)) where`

And then one could define `Num` instances for unlifted types.

This would make it possible to avoid using the ugly `+#` etc syntax for
operations on unlifted types.

`Int#` and `Word#` could have `Num` instances defined just as `Int` and
`Word` already have.

I presume there's a reason why this hasn't been done, but I was wondering
why?

Thanks,
Clinton

_______________________________________________
Glasgow-haskell-users mailing list
[email protected]
http://mail.haskell.org/cgi-bin/mailman/listinfo/glasgow-haskell-users