Quoting Bas van Dijk <v.dijk....@gmail.com>:

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

~d

_______________________________________________
Glasgow-haskell-users mailing list
Glasgow-haskell-users@haskell.org
http://www.haskell.org/mailman/listinfo/glasgow-haskell-users

Reply via email to