I just read the blog post of the initial release of the
Algorithms package and I'm kind of confused about this section:
The immediate focus of the package is to incubate a pragmatic set of algorithms generalized over the
Collectionfamily of protocols for eventual inclusion in the Swift standard library—the kind of functionality you might find in the Python itertools module or the C++ algorithms library.
There are many interesting and useful abstractions that don’t meet this criteria. For example:
- Currency types (e.g.
Result) and data structures (e.g.
- One-off conveniences (e.g.
Dictionary.subscript(key:default:)) that don’t generalize over
- Classic algorithms (e.g. quicksort, merge sort, heapsort, insertion sort, etc.) with more pragmatic alternatives
- Algorithms over non-linear data structures
- Why are those "interesting and useful abstractions" considered to not be included in the
- If not here, where else should they be included, directly into Swift or is there any other package planned for them with a different name?
- Or did I misunderstand this and you just mean you don't want to include those "interesting and useful abstractions" right now, because the "immediate focus" is different, but we could add them later? When would that "later" be?
I really got excited when I heard about this as I thought I could finally add some of the helpers from my Swift Standard Library extension library HandySwift directly into this package, like a
SortedArray type. But seeing
OrderedDictionary explicitly stated as a "doesn't meet criteria" example really got me confused. I'd like to at least understand the rationale here ...