Luciano Almeida
05df988369
[Chunked] Minor adjustments on tests
2021-01-10 17:18:49 -03:00
Luciano Almeida
afac704540
[Chunked] Implemeting of ChunkedByCount index(offsetBy:)
2021-01-09 00:17:49 -03:00
Luciano Almeida
79aeb24e9d
Fixing review comments
2021-01-08 08:21:01 -03:00
Luciano Almeida
505b57369f
[Chunked] Implementing chunked collection by a given count
2021-01-08 00:07:46 -03:00
Rafael Machado
3864606e00
Add "sortedPrefix(_:by)" to Collection ( #9 )
2020-12-04 10:20:28 -06:00
Nate Cook
e1c421c568
Fix typo
2020-12-04 10:16:09 -06:00
Nate Cook
638869256a
Add a few missing doc comments.
2020-12-02 16:28:23 -06:00
Tim Vermeulen
99152ecc68
Unify chunked(by:) and chunked(on:) ( #44 )
...
* Unify the eager `chunked(on:)` and `chunked(by:)`
* Unify the lazy `chunked(on:)` and `chunked(by:)`
* Trap when going past the end
* Add preconditions in `index(before:)`/`index(after:)`
2020-12-02 15:25:50 -06:00
Markus Winter
7af7ac2599
Clean up some comments ( #49 )
2020-12-02 10:21:06 -06:00
Nate Cook
ff01a02c07
Add Stride for Collection ( #24 )
2020-12-01 17:54:00 -06:00
Daniel Tull
93c8724c72
Add conformances to LazySequenceProtocol and LazyCollectionProtocol ( #47 )
...
* Conform Intersperse to LazySequenceProtocol when the base sequence does
* Add conformance to LazyCollectionProtocol
* Conform Indexed to LazyCollectionProtocol when Base conforms
* Rename XCTAssertLazy to XCTAssertLazySequence
* Add XCTAssertLazyCollection
* Add lazy test for Intersperse
* Update Indexed guide
* Add lazy conformances to SlidingWindows
* Update SlidingWindows guide
2020-12-01 15:47:13 -06:00
Tim Vermeulen
ad6dc7a143
Add random-access methods to SlidingWindows ( #42 )
2020-11-12 11:30:32 -06:00
Daniel Tull
fd189aa078
Add interspersed(with:) ( #35 )
2020-11-09 09:44:23 -06:00
Tim Vermeulen
6933a3157b
Avoid unnecessary computations in Product.distance(from:to:) ( #40 )
2020-11-06 15:06:23 -06:00
Oliver Atkinson
dfcc611e1d
consistant negative stride
2020-11-06 15:52:42 +00:00
Oliver Atkinson
3669ff0c11
offsetBackward n is positive and remove init? from Index
2020-11-06 15:33:03 +00:00
Oliver Atkinson
0a6bcc3c68
compute the stride only when the next element is requested
2020-11-06 15:25:34 +00:00
Oliver Atkinson
377bb72f0a
small documentation tweek collection -> sequence
2020-11-06 10:31:40 +00:00
Oliver Atkinson
28bbed8776
Add implementation for Sequence iterator
2020-11-06 10:13:29 +00:00
Oliver Atkinson
6f7148d966
Implementation of feedback from @timvermeulen
2020-11-06 09:46:06 +00:00
Oliver Atkinson
dcdef508c0
make base and stride internal
2020-11-02 10:02:17 +00:00
Oliver Atkinson
4a194ca811
remove redundant limit
2020-11-01 20:39:18 +00:00
Oliver Atkinson
6df6133ab7
Refactor to index(_:offsetBy:limitedBy:) and utilise the new test utilities for validateIndexTraversals
2020-11-01 20:30:17 +00:00
Oliver Atkinson
17cb07e38f
Add Stride for Collection
2020-11-01 20:30:10 +00:00
Oliver Atkinson
b28d248cab
Add sliding windows algorithm ( #20 )
2020-10-30 11:39:56 -05:00
Karl
f11d398c98
Add BidirectionalCollection.trimming ( #4 )
2020-10-30 10:44:14 -05:00
Roshan Kumar Sah
66ec96812a
Added documentation and where clause for API uniqued() ( #32 )
2020-10-26 17:12:48 -05:00
Nate Cook
c582aa9d22
Rename chained(with:) to chain(_:_:) ( #33 )
...
* Rename `chained(with:)` to `chain(_:_:)`
This follows a forum discussion about the `chained(with:)` name.
The old names are preserved as deprecated symbols.
* Remove conditional lazy conformance from `Chain2`
2020-10-23 16:45:51 -05:00
Tim Vermeulen
53354f3f21
Add conditional LazySequenceProtocol conformance ( #29 )
...
* Add conditional LazySequenceProtocol conformance where appropriate
* Add laziness tests
* Mention conditional conformance to LazySequenceProtocol in the guides
2020-10-21 23:58:21 -05:00
Nate Cook
8ca636d702
Add inlinability annotations throughout
2020-10-21 15:36:27 -05:00
Meler Paine
0dba0e5b87
fix stablePartition(subrange:by:) using subrange count instead of entire collection count. ( #30 )
2020-10-20 13:16:12 -05:00
Stephen Canon
a0b7954f80
Use Swift Numerics for elementary functions instead of Darwin/Glibc/etc ( #28 )
...
Also lets us use root instead of exp(log(x)/k), which is more accurate in some cases (but mainly is just nicer to read).
The downside is that this introduces a dependency for Algorithms, where previously it had none. I think that Numerics is an OK thing to depend on (especially for these functions, which are available from 0.0.1), but it _is_ a _massive increase_ in the number of dependencies that the package has, and we should give that some thought.
2020-10-19 16:40:31 -05:00
Tim Vermeulen
fb69aacc5d
Fix Product2's indexing logic ( #26 )
...
* Change representation of `Product2`'s `endIndex`
* Fix `Product2.index(before:)`
* Fix `Product2.distance(from:to:)`
* Make comment more specific
2020-10-15 10:41:33 -05:00
Tim Vermeulen
2beda36a49
Fix and improve Chain's index offsetting logic ( #22 )
...
* Add tests
* Fix offsetting logic
* Avoid unnecessary computations
2020-10-13 14:53:47 -05:00
Egor Zhdan
864d460a07
Fix build on Windows ( #13 )
...
log & exp are declared in `ucrt.corecrt.math`
2020-10-12 09:40:25 -05:00
Tim Vermeulen
c67dd3419c
Implement distance(from:to:) for Chain ( #3 )
...
* Add Chain.distance(from:to:)
* Add test
2020-10-12 09:36:13 -05:00
Nate Cook
dd2ad89a1b
Add missing documentation to rotate and reverse
2020-10-09 10:50:16 -05:00
Nate Cook
1df76cfaa4
Rename rotate(at:) to rotate(toStartAt:)
...
This was the intended name for the rotate method, just missed in
the initial release.
2020-10-09 10:50:16 -05:00
Ian Keen
cffb44dceb
Update Indexed.swift ( #8 )
2020-10-08 12:48:44 -05:00
Nate Cook
6cffd04a4f
Initial import
2020-10-07 10:24:43 -05:00