-
Notifications
You must be signed in to change notification settings - Fork 13
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
TestEquality clarification from core library devs #129
Comments
Fun. Since nearly all of our uses import the required class via That might ultimately be bad and confusing, though. |
I think duplicating the class and reusing the name would be strictly worse than doing nothing and having law-breaking instances. |
If I could go back in time, I would change Of course, going back and auditing all uses of I am not a huge fan of making our own |
I agree, Fortunately, we can make this transition gradually if we decide to do it, since |
I think repurposing |
A moment of greping around leads me to believe we'll find very few uses. The only "real" use of |
FWIW, the Heapster code uses |
I think Rob's point probably applies -- you should be able to keep using |
The library defined several `TestEquality` instances that lacked corresponding `EqF` instances. This patch adds these missing `EqF` instances. Where possible, I ensured that only `EqF` constraints are occurred (lest we end up with strange instances like `instance TestEquality f => EqF (T f)`, which are less general than they could be). This is one step towards a resolution for #129.
Looking more at #132 (which moves in the direction of a more useful class EqF f where
eqF :: f a -> f b -> Maybe (a :~: b) I like the fact that the arguments (of type data Proxy a = Proxy Per I bring this up because I have a downstream application where I am relying on an
|
The following patch has been approved and should eventually make it's way into
base
.https://gitlab.haskell.org/ghc/ghc/-/merge_requests/7333/diffs
It clarifies that
testEquality
should returnJust Refl
iff the corresponding type indices are the same, and reiterates that it is desirable that the class only be inhabited by singletons. This is incompatible with many of our typical uses of this class.The actual class declaration will not change, so nothing will immediately break with future releases of base. However, going forward we will have to decide what to do about the fact that many of our uses of
TestEquality
will be considered law-breaking.The text was updated successfully, but these errors were encountered: