I have a type class Shape that declares a number of functions common to all shapes. One of these functions (refine) needs to return a list of subshapes. To express this constraint, I use existential quantification:
data Shapeable = forall a . Shape a => Shapeable a
and have the function return [Shapeable]. I have an additional constraint that some shapes can be refined (via a refine function) while others can check for intersection (via an intersect function). These are mutually exclusive in that a shape that can refine itself cannot check for intersection and vice versa.
If I were not using the quantification, I would have just created two more typeclasses: Intersectable and Refineable. Is there a way to express disjoint function sets within a single typeclass like system?
I believe the closest you can get is by having two existential cases: