-
Notifications
You must be signed in to change notification settings - Fork 70
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
feat: immutable sort #255
Comments
I will take it. |
I want to develop a I think I should develop it using the Do you agree with this idea? |
Thank you for your interest in fxts. I’m curious about your reason for choosing a heap. A heap is an unstable sort, meaning that if there are elements with the same value, their initial order may not be preserved after sorting. For the toSorted spec, please refer to the polyfill in this link. The sort method uses How about implementing it with timSort? |
I'm sorry to my answer is too late. I �failed to consider heap is an unstable sort. but, I agree with your suggestion of thank you |
Suggestion
Since the sort of an array refers to a reference, the original array changes. Usually, functional programming treats an array in an immutable way.
The sort function of fxts does not support immutable.
As 'toSorted' is added as a new method of array, it would be good to support 'toSorted' in fxts. After implementing internally, if 'native to Sorted' compatibility is guaranteed, it would be better to replace the internal implementation then.
Reference
The text was updated successfully, but these errors were encountered: