Join GitHub today
GitHub is home to over 28 million developers working together to host and review code, manage projects, and build software together.
Sign upNested comparisons happen in unexpected order #568
Comments
This comment has been minimized.
Show comment
Hide comment
This comment has been minimized.
Show comment
Hide comment
|
This should be "fixed" by 6f5fbb8. |
evancz
closed this
Jun 25, 2016
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
jvoigtlaender commentedApr 24, 2016
In comparing, say, tuples
(a,b,c)vs.(d,e,f), the natural expectation is that firstaanddare compared and only if these are equal,bandeare 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 toa==c && b==d, not tob==d && a==c.