Is it possible to place an inequality constraint on the typevariables of a function, à la foo :: (a ~ b) => a -> b as in GHC type family docs, except ineq
foo :: (a ~ b) => a -> b
From GHC 7.8.1. closed type families are available. The solution is much simpler with them:
data True data False type family TypeEqF a b where TypeEqF a a = True TypeEqF a b = False type TypeNeq a b = TypeEqF a b ~ False