Skip to content
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

want deterministic letrec binding order to minimize diffs #5606

Open
aryairani opened this issue Mar 5, 2025 · 1 comment
Open

want deterministic letrec binding order to minimize diffs #5606

aryairani opened this issue Mar 5, 2025 · 1 comment
Labels

Comments

@aryairani
Copy link
Contributor

Describe and demonstrate the bug
We have seen letrec binding order swapped depending on changed dependency hashes, which is problematic for text-based diff tools.

Possible static orderings could be one of

  • the order that the author specified, if preserved; currently not preserved
  • alphabetical

For now, we might as well go with Alphabetical since they're not fixed anyway.

@aryairani aryairani added the bug label Mar 5, 2025
@aryairani
Copy link
Contributor Author

aryairani commented Mar 5, 2025

It looks like letrecs are sorted by Symbol, and Symbols are sorted by freshness-id

instance Ord Symbol where
Symbol id1 name1 `compare` Symbol id2 name2 = (id1, name1) `compare` (id2, name2)

So we should try swapping that so that they're sorted by name (which is actually Unison.Var.Type) and hope that nothing to do with shadowing or scoping depends on Ord Symbol.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant