This is harder than I thought it would be yesterday: an instance like
deriving instance (FooAll Eq a) => Eq Bar
makes no sense: what is the a in the context? Does it mean (forall a. FooAll Eq a)? That might work but it requires QuantifiedConstraints and anyway there must be a better solution.
Maybe each datatype has to go through its constructors, see how everything else in the group is being used, and collect all the constraints that arise?
Edited to add extra context:
Given the input
the output contains an instance
with a context that is total nonsense.
This is harder than I thought it would be yesterday: an instance like
makes no sense: what is the
a
in the context? Does it mean(forall a. FooAll Eq a)
? That might work but it requiresQuantifiedConstraints
and anyway there must be a better solution.Maybe each datatype has to go through its constructors, see how everything else in the group is being used, and collect all the constraints that arise?