-
Notifications
You must be signed in to change notification settings - Fork 37
Get rid of Stdlib.compare and Stdlib.(=) #1117
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
Merged
bclement-ocp
merged 2 commits into
OCamlPro:next
from
Halbaroth:get-rid-of-stdlib-compare
May 13, 2024
Merged
Changes from all commits
Commits
Show all changes
2 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change | ||||
|---|---|---|---|---|---|---|
|
|
@@ -1955,9 +1955,9 @@ module Triggers = struct | |||||
| | { f = (Name _) as s1; xs=tl1; _ }, { f = (Name _) as s2; xs=tl2; _ } -> | ||||||
| let l1 = List.map score_term tl1 in | ||||||
| let l2 = List.map score_term tl2 in | ||||||
| let l1 = List.fast_sort Stdlib.compare l1 in | ||||||
| let l2 = List.fast_sort Stdlib.compare l2 in | ||||||
| let c = Util.cmp_lists l1 l2 Stdlib.compare in | ||||||
| let l1 = List.fast_sort Int.compare l1 in | ||||||
| let l2 = List.fast_sort Int.compare l2 in | ||||||
| let c = Util.cmp_lists l1 l2 Int.compare in | ||||||
| if c <> 0 then c | ||||||
| else | ||||||
| let c = Sy.compare s1 s2 in | ||||||
|
|
@@ -1990,15 +1990,15 @@ module Triggers = struct | |||||
|
|
||||||
| | { f = Op (Access a1) ; xs=[t1]; _ }, | ||||||
| { f = Op (Access a2) ; xs=[t2]; _ } -> | ||||||
| let c = Stdlib.compare a1 a2 in (* should be Hstring.compare *) | ||||||
| let c = Hstring.compare a1 a2 in (* should be Hstring.compare *) | ||||||
| if c<>0 then c else cmp_trig_term t1 t2 | ||||||
|
|
||||||
| | { f = Op (Access _); _ }, _ -> -1 | ||||||
| | _, { f = Op (Access _); _ } -> 1 | ||||||
|
|
||||||
| | { f = Op (Destruct a1) ; xs = [t1]; _ }, | ||||||
| { f = Op (Destruct a2) ; xs = [t2]; _ } -> | ||||||
| let c = Stdlib.compare a1 a2 in (* should be Hstring.compare *) | ||||||
| let c = Hstring.compare a1 a2 in (* should be Hstring.compare *) | ||||||
|
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
Collaborator
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Same here |
||||||
| if c<>0 then c else cmp_trig_term t1 t2 | ||||||
|
|
||||||
| | { f = Op (Destruct _); _ }, _ -> -1 | ||||||
|
|
@@ -2013,9 +2013,9 @@ module Triggers = struct | |||||
| (* ops that are not infix or prefix *) | ||||||
| let l1 = List.map score_term tl1 in | ||||||
| let l2 = List.map score_term tl2 in | ||||||
| let l1 = List.fast_sort Stdlib.compare l1 in | ||||||
| let l2 = List.fast_sort Stdlib.compare l2 in | ||||||
| let c = Util.cmp_lists l1 l2 Stdlib.compare in | ||||||
| let l1 = List.fast_sort Int.compare l1 in | ||||||
| let l2 = List.fast_sort Int.compare l2 in | ||||||
| let c = Util.cmp_lists l1 l2 Int.compare in | ||||||
| if c <> 0 then c | ||||||
| else | ||||||
| let c = Sy.compare s1 s2 in | ||||||
|
|
@@ -2029,9 +2029,9 @@ module Triggers = struct | |||||
| let cmp_trig_term_list tl2 tl1 = | ||||||
| let l1 = List.map score_term tl1 in | ||||||
| let l2 = List.map score_term tl2 in | ||||||
| let l1 = List.rev (List.fast_sort Stdlib.compare l1) in | ||||||
| let l2 = List.rev (List.fast_sort Stdlib.compare l2) in | ||||||
| let c = Util.cmp_lists l1 l2 Stdlib.compare in | ||||||
| let l1 = List.rev (List.fast_sort Int.compare l1) in | ||||||
| let l2 = List.rev (List.fast_sort Int.compare l2) in | ||||||
| let c = Util.cmp_lists l1 l2 Int.compare in | ||||||
| if c <> 0 then c else Util.cmp_lists tl1 tl2 cmp_trig_term | ||||||
|
|
||||||
| let unique_stable_sort = | ||||||
|
|
||||||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
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.
I removed it another PR ;)
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.
I may be missing something but given that this is the PR that fixes the issue identified by the comment, it should also be the one removing the comment.
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.
I know but in fact this PR is extracted from #1098 . I can do it twice if you want...
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.
It would have been better to avoid the inconsistent state one way or another. That said, this being replaced by
Uid.compare(I suppose?) in that PR makes sense; I have to review PRs as they are and can't really infer what "another PR" refers to — thanks for the clarification.