ConstraintKinds and default associated empty constraints

wagnerdm at wagnerdm at
Thu Dec 22 01:58:26 CET 2011

Quoting Bas van Dijk <v.dijk.bas at>:

> I'm playing a bit with the new ConstraintKinds feature in GHC
> 7.4.1-rc1. I'm trying to give the Functor class an associated
> constraint so that we can make Set an instance of Functor. The
> following code works but I wonder if the trick with: class Empty a;
> instance Empty a, is the recommended way to do this:

Maybe something like this?

class Functor f where
     type C f a :: Constraint
     type C f a = ()

instance Functor Set where
     type C Set a = Ord a


More information about the Glasgow-haskell-users mailing list