-
Notifications
You must be signed in to change notification settings - Fork 57
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
Deriving Ord
#3184
Deriving Ord
#3184
Conversation
881b1ef
to
123220b
Compare
c1f0151
to
7f97da9
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The generated function for Ord
should directly call itself recursively for recursive constructor arguments instead of implicitly relying on instance resolution to do this (which results in inefficient code later on). So instead of creating a lambda, create a local recursive function with a let and check the type of constructor arguments, like in the PR:
commit 432114c2de274bfb7c20e5d406e50e69ed095559 Author: Jan Mas Rovira <janmasrovira@gmail.com> Date: Tue Nov 26 16:19:56 2024 +0100 test086 -> test087 commit 8b3f47b Author: Jan Mas Rovira <janmasrovira@gmail.com> Date: Fri Nov 22 17:50:05 2024 +0100 move commit 7f97da9 Author: Jan Mas Rovira <janmasrovira@gmail.com> Date: Fri Nov 22 15:35:19 2024 +0100 change order of definition commit 094c6e9 Author: Jan Mas Rovira <janmasrovira@gmail.com> Date: Fri Nov 22 13:39:14 2024 +0100 add test commit 42a3476 Author: Jan Mas Rovira <janmasrovira@gmail.com> Date: Fri Nov 22 13:13:09 2024 +0100 refactor commit b5fe58f Author: Jan Mas Rovira <janmasrovira@gmail.com> Date: Fri Nov 22 11:05:24 2024 +0100 change order of Bool constructors commit 03210ab Author: Jan Mas Rovira <janmasrovira@gmail.com> Date: Fri Nov 22 10:12:17 2024 +0100 update stdlib commit 59456df Author: Jan Mas Rovira <janmasrovira@gmail.com> Date: Thu Nov 21 19:52:23 2024 +0100 update stdlib commit 0f2fae6 Author: Jan Mas Rovira <janmasrovira@gmail.com> Date: Thu Nov 21 19:42:00 2024 +0100 decrease clause number commit 25325bc Author: Jan Mas Rovira <janmasrovira@gmail.com> Date: Thu Nov 21 19:28:53 2024 +0100 improve commit 6fe818e Author: Jan Mas Rovira <janmasrovira@gmail.com> Date: Thu Nov 21 18:53:31 2024 +0100 fixes commit 5858b9b Author: Jan Mas Rovira <janmasrovira@gmail.com> Date: Thu Nov 21 16:59:39 2024 +0100 derive ord commit 6c4db73 Author: Jan Mas Rovira <janmasrovira@gmail.com> Date: Wed Nov 20 18:05:12 2024 +0100 wip
8b3f47b
to
78dec07
Compare
Allows automatic derivation of
Ord
instances. It generates a lexicographical order equivalent to the one defined by Haskell's stock deriving.