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

support native Set and Map values #12

Merged
merged 1 commit into from
Jan 10, 2020
Merged

Conversation

davidchambers
Copy link
Member

Insertion order is respected, so show (new Set ([1, 2, 3]))show (new Set ([3, 2, 1])).

Sorting would be unnecessarily restrictive: Set a would satisfy Showable only if a satisfies Ord.

In various test suites we define eq which asserts that show (actual) = show (expected) before asserting that equals (actual) (expected) = true. We will now need to ensure that actual and expected have the same insertion order anywhere we apply eq to native Set or Map values.

@Avaq
Copy link
Member

Avaq commented Jan 9, 2020

We will now need to ensure that actual and expected have the same insertion order anywhere we apply eq to native Set or Map values.

That's just a side-effect of how eq has been defined in terms of show, and not necessarily indicative of an implementation fault of show. I think it's perfectly acceptable.

@davidchambers davidchambers merged commit 06cc37e into master Jan 10, 2020
@davidchambers davidchambers deleted the davidchambers/js-set-map branch January 10, 2020 21:22
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants