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

Does uniq preserve order? #62

Closed
trieloff opened this issue Dec 4, 2019 · 4 comments · Fixed by #164
Closed

Does uniq preserve order? #62

trieloff opened this issue Dec 4, 2019 · 4 comments · Fixed by #164
Assignees
Labels
question Further information is requested released

Comments

@trieloff
Copy link
Contributor

trieloff commented Dec 4, 2019

It would be worth noting if uniq preserves the order of elements in the sequence or not. Preserving order would be better, but might be unattainable with the Set based implementation.

@trieloff trieloff added the question Further information is requested label Dec 4, 2019
@koraa
Copy link
Contributor

koraa commented Dec 4, 2019

Depends on the definition of order preserving. For an imagined example new Set([1,2,1]), what would you expect the order to be? Both [1,2] and [2,1] could be considered order preserving.

The Set documentation states:

You can iterate through the elements of a set in insertion order.

This effectively guarantees that the order would be [1,2]. Does that fit your use case?

@koraa
Copy link
Contributor

koraa commented Dec 4, 2019

If it fits your use case, would you mind adding that to the documentation and providing tests so this is marked as an official feature?

@trieloff
Copy link
Contributor Author

trieloff commented Dec 9, 2019

[1, 2] is what I'd expect.

@trieloff trieloff self-assigned this Dec 9, 2019
koraa added a commit that referenced this issue Jan 28, 2020
This makes sure that all functions have examples; since most
examples are in the style of tests, redundant tests are removed.

Fixes: #87
Fixes: #62 (Adds an appropriate test for uniq())
koraa added a commit that referenced this issue Mar 4, 2021
This makes sure that all functions have examples; since most
examples are in the style of tests, redundant tests are removed.

Fixes: #87
Fixes: #62 (Adds an appropriate test for uniq())
@koraa koraa closed this as completed in #164 Mar 4, 2021
koraa added a commit that referenced this issue Mar 4, 2021
This makes sure that all functions have examples; since most
examples are in the style of tests, redundant tests are removed.

Fixes: #87
Fixes: #62 (Adds an appropriate test for uniq())
adobe-bot pushed a commit that referenced this issue Mar 4, 2021
# [1.8.0](v1.7.0...v1.8.0) (2021-03-04)

### Features

* Move tests into the documentation examples ([c033897](c033897)), closes [#87](#87) [#62](#62)
@adobe-bot
Copy link

🎉 This issue has been resolved in version 1.8.0 🎉

The release is available on:

Your semantic-release bot 📦🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
question Further information is requested released
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants