-
Notifications
You must be signed in to change notification settings - Fork 291
Human-centric let-rec, constructor and ability orderings #6039
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
base: trunk
Are you sure you want to change the base?
Conversation
|
Q before merging, @aryairani @mitchellwrosen , Maybe I should not do this for structural types just to be sure? |
|
@ChrisPenner did you see #5893 it gives the safe criteria you can use for sorting |
I'm going to do a quick transcript for this, but one answer is that Now what about for unique types? Do we not have the same problem? |
|
@ChrisPenner 0 = False; 1 = True Oh good, nothing's changed. Oh just kidding, it actually did change. 0 is True and 1 is False. It doesn't break any code, but it may break your mind. Same issue here, possibly less surprising. |
Overview
We've noticed that since let-rec bindings, constructors, and ability lists are all ordered by hash, they sometimes jump around when you make changes; this means the diffs also get much worse since the bindings might have completely re-ordered in-between changes.
internal ticket
There's no real need for these to be printed in hash-order, since the parser will re-order them according to hash on ingestion anyways.
This changes the printer to put things in a consistent order by name rather than hash.
Implementation approach and notes
Add some
sorts in the printer modules.Test coverage
print-ordering.mdtranscript tests; as well as all the re-rendered existing transcripts