marpple / FxTS

A functional programming library for TypeScript/JavaScript
https://fxts.dev
Apache License 2.0
858 stars 64 forks source link

feat: immutable sort #255

Open hg-pyun opened 3 months ago

hg-pyun commented 3 months ago

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

hg-pyun commented 3 months ago

I will take it.