This wiki page summarises the state of play on the idea of allowing quantification in class constraints. For example
data Rose f a = Branch a (f (Rose f a)) instance (Eq a, forall b. (Eq b) => Eq (f b)) => Eq (Rose f a) where ...
The new bit is the
forall in the context of the instance declaration. This is allowed in GHC 8.6 and later using the
Here are some resources
Derivable type classes, Section 7, where the idea was first proposed (I think).
#2893 (closed), a ticket about the idea
See the QuantifiedConstraints label for tickets.