Ticket #7642 (closed feature request: fixed)
Nullary type classes
GHC supports MultiParamTypeClasses with two or more parameters, but it explicitly rejects classes with no parameters. There doesn't seem to be a good reason for that.
Some example uses that came up in IRC:
isPrime :: RiemannHypothesis => Integer -> Bool unsafePerformIO :: Unsafe => IO a -> a
The main reason to allow it is probably that it's a pointless restriction, like EmptyDataDecls?. In fact, the simplest implementation for this patch consists of deleting one line of code. The attached patch is slightly bigger because it also fixes error messages (I also included a detabbing patch).
If necessary this can be made a separate LANGUAGE flag -- this patch just folds it into MultiParamTypeClasses.