Name | Modified | Size | Downloads / Week |
---|---|---|---|
Parent folder | |||
README.md | 2023-11-15 | 941 Bytes | |
Swift Algorithms 1.2.0 source code.tar.gz | 2023-11-15 | 248.1 kB | |
Swift Algorithms 1.2.0 source code.zip | 2023-11-15 | 305.5 kB | |
Totals: 3 Items | 554.5 kB | 3 |
Additions
- Sequences have new
grouped(by:)
andkeyed(by:)
methods, which simplify building dictionaries based on sequence elements: (#197)
```swift let evensOdds = (1...10).grouped(by: { $0.isMultiple(of: 2) ? "even" : "odd" }) // ["even": [2, 4, 6, 8, 10], "odd": [1, 3, 5, 7, 9]]
let animals = ["Aardvark", "Alpaca", "Armadillo", "Barracuda", "Buffalo", ...] let alphaAnimals = animals.keyed(by: .first!, resolvingConflictsWith: { _, first, _ in first }) // ["A": "Aardvark", "B": "Barracuda", ...] ```
- The
endOfPrefix(while:)
andstartOfSuffix(while)
methods are now public. These methods were previously implementation details of thetrimming
group of methods. (#211)
Fixes
- Documentation and performance improvements. (#202, [#210])
The 1.2.0 release includes contributions from @amomchilov, @mattyoung, @natecook1000, @stephentyrone, and @ttsugriy. Thank you!