Unclaimed project
Are you a maintainer of swift-algorithms? Claim this project to take control of your public changelog and roadmap.
Changelog
Commonly used sequence and collection algorithms for Swift
New nonmutating partitioned(by:) methods that return both the failing and passing elements of a sequence or collection in separate arrays. (#152)
let cast = ["Vivien", "Marlon", "Kim", "Karl"]
let (longNames, shortNames) = cast.partitioned(by: { $0.count < 5 })
print(longNames)
// Prints "["Vivien", "Marlon"]"
print(shortNames)
// Prints "["Kim", "Karl"]"
A new evenlyChunked(in:) method that chunks a sequence or collection into the specified number of evenly-sized subsequences. (#96)
let numbers = Array(0..<10)
for chunk in numbers.evenlyChunked(in: 4) {
print(chunk)
}
// Prints:
// [0, 1, 2]
// [3, 4, 5]
// [6, 7]
// [8, 9]
The 1.1.0 release includes contributions from @dickoff, @gwynne, @mdznr, @natecook1000, @ole, @stephentyrone, and @timvermeulen. Thank you!
Now we have become very big, Different from the original idea. Collect premium software in various categories.
The Swift Programming Language
A tool for creating and running Linux containers using lightweight virtual machines on a Mac. It is written in Swift, and optimized for Apple silicon.
The modern video player for macOS.