Skip to content

Conversation

Julow
Copy link
Collaborator

@Julow Julow commented Mar 1, 2021

No data need to be elided so Stdlib.compare and Hashtbl.hash can be used.


let compare x y =
match (x, y) with
| Internal (x, _), Internal (y, _) -> String.compare x y
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Eliding this field was probably the reason of all this but I think this is not right because we use this function for data-structures, where this would be hazardous, and never intentionally for checking that two Internal have the same name.
Also, equal above uses ( = ).

@Julow Julow force-pushed the cleanup-hash-compare branch from 2f4b810 to df08828 Compare March 1, 2021 15:45
@jonludlam
Copy link
Member

Needs another rebase!

Julow added 2 commits March 10, 2021 11:53
This was eliding no fields and there is no data that can't be hashed by
Hashtbl.hash.
Stdlib.compare can be used on these types.
@Julow Julow force-pushed the cleanup-hash-compare branch from df08828 to 9d1e074 Compare March 10, 2021 10:55
@Julow
Copy link
Collaborator Author

Julow commented Mar 10, 2021

Rebased.

@jonludlam
Copy link
Member

Thanks!

@jonludlam jonludlam merged commit f4006cb into ocaml:master Mar 10, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants