Download Latest Version Swift Algorithms 1.2.1 source code.tar.gz (256.6 kB)
Email in envelope

Get an email when there's a new version of Swift Algorithms

Home / 1.0.0
Name Modified Size InfoDownloads / Week
Parent folder
README.md 2021-09-08 1.9 kB
Swift Algorithms 1.0.0.tar.gz 2021-09-08 234.1 kB
Swift Algorithms 1.0.0.zip 2021-09-08 283.0 kB
Totals: 3 Items   518.9 kB 6

Swift Algorithms is now source stable!

Changes

  • Most sequence and collection types have been renamed, following a more consistent naming structure:
  • The Lazy prefix was dropped.
  • Either a Sequence or Collection suffix 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.
  • Types that can only be produced from a lazy sequence chain now unconditionally conform to LazySequenceProtocol and wrap the base sequence instead of the lazy wrapper, making some return types slightly simpler.
  • e.g. [1, 2, 3].lazy.reductions(+) now returns ExclusiveReductionsSequence<[Int]>, not ExclusiveReductionsSequence<LazySequence<[Int]>>.
  • The generic parameters of the ExclusiveReductions type have been swapped, putting the base collection first and the result type second.
  • The Indices associated type of IndexedCollection now matches Base.Indices.

Removals

  • Previously deprecated type and method names have been removed:
  • The Chain type alias for Chain2Sequence
  • The chained(with:) method which was replaced with the chain(_:_:) free function
  • The LazyChunked and Chunked type aliases for ChunkedByCollection
  • The rotate(subrange:at:) and rotate(at:) methods which were renamed to rotate(subrange:toStartAt:) and rotate(toStartAt:) respectively

Fixes

  • The StridingSequence and StridingCollection types now conditionally conform to LazySequenceProtocol, allowing the striding(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)
Source: README.md, updated 2021-09-08