I'm using
{-# LANGUAGE TypeFamilies, DataKinds, ConstraintKinds, ExistentialQuantification #-}
and have typed the following code:
class NoConstraint x where {}
instance forall x. NoConstraint x where {}
type family Classes (c :: [* -> Constraint]) (x :: *) :: Constraint
type instance Classes [] x = NoConstraint x
type instance Classes (h : t) x = (h x, Classes t x)
However, GHC(i) rejects this with:
Not in scope: type constructor or class `Constraint'
It seems to be, however, that this should be completely possible.
Edit: I've now found out that there are also other problems with the above code.
However, this remains a valid question.