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

Nested comparisons happen in unexpected order #568

Closed
jvoigtlaender opened this Issue Apr 24, 2016 · 1 comment

Comments

Projects
None yet
2 participants
@jvoigtlaender
Contributor

jvoigtlaender commented Apr 24, 2016

In comparing, say, tuples (a,b,c) vs. (d,e,f), the natural expectation is that first a and d are compared and only if these are equal, b and e are compared, etc.

But that's not what is currently happening. That it's happening in reverse at the moment can be seen from the facts that ( True , identity ) == ( False , \x -> x ) does trigger a runtime error but ( identity , True ) == ( \x -> x , False ) doesn't.

In more realistic code it will more likely not be about runtime errors but about efficiency. But still, the natural expectation would be that (a,b) == (c,d) is equivalent to a==c && b==d, not to b==d && a==c.

@evancz

This comment has been minimized.

Show comment
Hide comment
@evancz

evancz Jun 25, 2016

Member

This should be "fixed" by 6f5fbb8.

Member

evancz commented Jun 25, 2016

This should be "fixed" by 6f5fbb8.

@evancz evancz closed this Jun 25, 2016

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment