Name | Modified | Size | Downloads / Week |
---|---|---|---|
Parent folder | |||
README.md | 2023-10-05 | 1.1 kB | |
Swift Algorithms 1.1.0.tar.gz | 2023-10-05 | 241.8 kB | |
Swift Algorithms 1.1.0.zip | 2023-10-05 | 295.8 kB | |
Totals: 3 Items | 538.8 kB | 0 |
Additions
-
New nonmutating
partitioned(by:)
methods that return both the failing and passing elements of a sequence or collection in separate arrays. (#152)```swift 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)swift 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]
Changes
- The package now has a minimum Swift version of Swift 5.4.
Fixes
- Improvements to documentation, including a new DocC-based documentation structure.
The 1.1.0 release includes contributions from @dickoff, @gwynne, @mdznr, @natecook1000, @ole, @stephentyrone, and @timvermeulen. Thank you!