Apple announced an open-source algorithms project with some very over-the-top, flashy language. 😉
I’m excited to announce Swift Algorithms, a new open-source package of sequence and collection algorithms, along with their related types.
This library seems to be a sort of farm league for things that might make it to big leagues of the Swift Standard Library eventually.
Swift Algorithms lets you do just about anything you can think of with a collection (or two). It lets you do stuff like rotate
[10, 20, 30, 40, 50, 60] to
[30, 40, 50, 60, 10, 20], or find all possible permutations of
[10, 20, 30], and lots of other things like chunking, random sampling, etc. Fun. 🤓
Via iOS Dev Weekly.
2 thoughts on “Swift Algorithms”