Swift Algorithms 1.0.0
Swift Algorithms is now source stable!
Changes
- Most sequence and collection types have been renamed, following a more consistent naming structure:
- The
Lazyprefix was dropped. - Either a
SequenceorCollectionsuffix was added depending on whether or not the type is unconditionally a collection. - The base name was derived from the name of the method that produces it, including an argument label to disambiguate if necessary.
- The
- Types that can only be produced from a lazy sequence chain now unconditionally conform to
LazySequenceProtocoland wrap the base sequence instead of the lazy wrapper, making some return types slightly simpler.- e.g.
[1, 2, 3].lazy.reductions(+)now returnsExclusiveReductionsSequence<[Int]>, notExclusiveReductionsSequence<LazySequence<[Int]>>.
- e.g.
- The generic parameters of the
ExclusiveReductionstype have been swapped, putting the base collection first and the result type second. - The
Indicesassociated type ofIndexedCollectionnow matchesBase.Indices.
Removals
- Previously deprecated type and method names have been removed:
- The
Chaintype alias forChain2Sequence - The
chained(with:)method which was replaced with thechain(_:_:)free function - The
LazyChunkedandChunkedtype aliases forChunkedByCollection - The
rotate(subrange:at:)androtate(at:)methods which were renamed torotate(subrange:toStartAt:)androtate(toStartAt:)respectively
- The
Fixes
- The
StridingSequenceandStridingCollectiontypes now conditionally conform toLazySequenceProtocol, allowing thestriding(by:)method to properly propagate laziness in a lazy sequence chain. - Fixed
chunked(by:)to always compare two consecutive elements rather than each element with the first element of the current chunk. (#162)