Data.Parameterized.TH.GADT
: Offer a helper for automating EqF
instances
#175
Labels
Data.Parameterized.TH.GADT
: Offer a helper for automating EqF
instances
#175
Data.Parameterized.TH.GADT
currently offersstructuralTypeEquality
, which automates the generation ofTestEquality
instances, but it does not yet offer a counterpart for generatingEqF
instances. The closest thing that currently exists isstructuralEquality
, but this is unsuitable forEqF
instances in general because it is implemented asisJust (... testEquality ...)
under the hood. This means that you can end up with instances that look likeinstance TestEquality f => EqF (T f)
, which uses a stronger instance context than what is necessary.We should offer a variant of
structuralEquality
which generates code that gives rise toinstance Eq f => EqF (T f)
instead.The text was updated successfully, but these errors were encountered: