I suppose what I want is impossible without Template Haskell but I\'ll ask anyway.
I have an interface for types like Data.Set
and Data.IntSet
Using GHC 7.4's constraint kinds you could have something like
type EfficientSetLike a = (SetLike (EfficientSet a),Elem (EfficientSet a) ~ a)
You can (with appropriate extensions) get constraints like this in earlier versions of GHC
class (SetLike (EfficientSet a),Elem (EfficientSet a) ~ a) => EfficientSetLike a
instance (SetLike (EfficientSet a),Elem (EfficientSet a) ~ a) => EfficientSetLike a
But, the new style type
declaration is much nicer.
I'm not exactly sure what you are looking for, but it sounds like you just want easier to write/understand constraint signatures, in which case this will work.