Commit Graph

65 Commits

Author SHA1 Message Date
Karoy Lorentey
063c8456a1 [stdlib] Take out primary associated types on LazySequenceProtocol/LazyCollectionProtocol for now 2022-05-09 18:09:21 -07:00
Karoy Lorentey
7a7ebd8970 [stdlib] Adopt primary associated types in the stdlib 2022-05-09 18:06:17 -07:00
Alex Martini
17d3b01b48 Remove trailing double tabs. 2022-03-01 14:46:40 -08:00
Paul Hudson
06f82a53b5 Replaced the majority of ' : ' with ': '. 2019-07-18 20:46:07 +01:00
Ben Cohen
f86fc100a5 Ditch the underscore 2018-11-15 20:55:10 -08:00
Ben Cohen
7df1587c27 Restore LazyCollection, but deprecated 2018-11-15 20:54:13 -08:00
Ben Cohen
df2307e035 [stdlib][DNM] Collapse sequence and collection wrappers (#20221)
* Concretize dropFirst/Last/sufix/prefix from Sequence

Remove split customization point

Eliminate SubSequence from Sequence protocol

Collapse LazyCollection

Collapse LazyMapCollection

Eliminate _SequenceWrapper

Collapse LazyFilterCollection

Collapse LazyDrop/PrefixWhileCollection

Fix tests, ABI stability update

Collapse FlattenSequence

* Add entries to source/ABI compatible expected results.

* Update tests to avoid pre-10.14 objc runtime bug

* Expunge _preprocessingPass
2018-11-14 10:05:58 -08:00
Ben Cohen
dbc2e21522 Remove customization points from Sequence and Collection (#19995) 2018-10-31 18:58:00 -07:00
Ben Cohen
9ce2143335 Additional ownership annotations 2018-10-03 19:10:22 -07:00
Ben Cohen
ae6f5dd604 [stdlib] Add consuming/owned annotations to Collection implementations (#19360)
* Add consuming/owned annotations to Collection implementations

* Update SILOptimizer tests

* Fix access_marker_verify test

* XFAIL reconstruct_type_from_mangled_name
2018-09-21 12:06:56 -07:00
Ben Cohen
4694310e51 [stdlib] Some minor cleanup (#18130)
* Remove case destructuring to _

* Remove some Iterator.Element

* Which idiot wrote this? Oh.

* Switch NibbleSort to just use default impls... shouldn't change perf
2018-07-21 17:29:57 -07:00
Ben Cohen
c6b41a5ae5 Inlineable: protocol interface only 2018-07-06 12:03:34 -07:00
Ben Cohen
a4230ab2ad [stdlib] Update stdlib to 4.0 and reorganize compatibility shims (#17580)
* Update stdlib to 4.0 and move all compatibility shims into a dedicated source file
2018-06-29 06:26:52 -07:00
Nate Cook
b1ab7d89db [stdlib] Implement sequence/collection methods for searching from the end (#13337)
This implements the new last(where:), and lastIndex(of/where:) methods as
extensions on `BidirectionalCollection`, which partially implements SE-204.
The protocol requirements for `Sequence` and `Collection` as described
in the proposal need to wait until there's a solution for picking up the
specialized versions in types that conditionally conform to `BidirectionalCollection`.
2018-04-23 20:47:26 -05:00
Slava Pestov
2e5aef9c8d stdlib: Remove redundant @usableFromInline attributes 2018-04-06 00:02:30 -07:00
Slava Pestov
e1f50b2d36 SE-0193: Rename @_inlineable to @inlinable, @_versioned to @usableFromInline 2018-03-30 21:55:30 -07:00
Nate Cook
0782b482b3 [stdlib] Documentation improvements
- Revise Equatable and Hashable for synthesized requirements
- Complete Strideable and stride(from:...:by:) documentation
- Revise DoubleWidth type docs
- Add complexity notes for Set.index(of:) and .contains(_:)
- Fix typos in Set.formUnion docs
- Add missing axioms for SetAlgebra (SR-6319)
- Improve guidance for description and debugDescription
- Add note about the result of passing duplicate keys to
  Dictionary(uniqueKeysWithValues:)
- Fix typo in BinaryInteger docs
- Update Substring docs with better conversion example
- Improve docs for withMemoryRebound and isKnownUniquelyReferenced
- Add missing docs not propagated from protocols
2018-01-05 17:06:44 -06:00
Thomas Di Meco
ea49459b75 [stdlib] Updated underestimatedCount doc related to complexity
There were inconsistencies in the documentation about the complexity of the underestimatedCount property.
2018-01-02 18:48:29 +01:00
Ben Cohen
9361a6b66f [stdlib] Nest Iterator and Index types for various stdlib types (#13489)
* Nest various top-level Iterator and Index types, and flatten extensions.

* Fix tests from nesting iterator

* Nest Unsafe*BufferPointer.Iterator, extensionify UnsafeBufferPointer

* Degyb LazyCollection

* Nest Flatten iterator and index
2017-12-18 15:27:35 -08:00
Max Moiseev
590f62f3bd [stdlib][swift-3-indexing-model] introducing new LazyCollections
- Instead of just one there are now three:
  - LazyCollection
  - LazyBidirectionalCollection
  - LazyRandomAccessCollection
- ReversedCollection now conforms to BidirectionalCollection
- Lazy tests compile and run (#if'ed pieces that don't typecheck)
2016-04-08 11:06:05 -07:00
Nate Cook
6b77c6a979 [New indexing model] Update documentation comments with new APIs
Most of these were successor() -> successor(of:).
2016-04-08 01:01:58 -05:00
Nate Cook
34773e9612 [New indexing model] Revise documentation for collections
- Revised outdated descriptions
- Added missing documentation comment blocks
- Added preconditions where possible now that Index: Comparable
2016-04-07 16:53:11 -05:00
Max Moiseev
b7a1b1d1e0 Revert "[stdlib][swift-3-indexing-model] introducing new LazyCollections"
This reverts commit 5ad441f35a.
2016-04-06 13:07:31 -07:00
Max Moiseev
5ad441f35a [stdlib][swift-3-indexing-model] introducing new LazyCollections
- Instead of just one there are now three:
  - LazyCollection
  - LazyBidirectionalCollection
  - LazyRandomAccessCollection
- ReversedCollection now conforms to BidirectionalCollection
- Lazy tests compile and run (#if'ed pieces that don't typecheck)
2016-04-06 10:11:30 -07:00
Dave Abrahams
da5c4036ac func index(n: IndexDistance, stepsFrom i: Index)
M-x findr-query-replace

\<func advance(\([^(),]*\|[^(),]+([^()]*)[^(),]*\)\(,[
]*\)by \([^(),]*\|[^(),]+([^()]*)[^(),]*\)

func index(\3\2stepsFrom \1
2016-03-28 13:23:04 -07:00
Dave Abrahams
81d3e8ca83 limit: => limitedBy:, pt 2
M-x findr-query-replace

\<limit: \([^(),]*\|[^(),]+([^()]*)[^(),]*\))\( *\(?:[^ -]\|-[^>]\)\)

limitedBy: \1)\2
2016-03-28 13:12:02 -07:00
Dave Abrahams
4d651f8fc0 limit: => limitedBy:, pt 1
M-x findr-query-replace

\(,[
]*\)limit: \([^(),]*\|[^(),]+([^()]*)[^(),]*\)) ->

\1limitedBy limit: \2) ->
2016-03-28 13:03:59 -07:00
Dave Abrahams
01127b32d5 index(n, stepsFrom: i)
M-x findr-query-replace

\<advance(\([^:]+?\),\([
]+\)by: *\([^(),]*\|[^(),]+([^()]*)[^(),]*\)\(,\(?:[
]+\)limit: *\(?:[^()]*\|[^()]+([^()]*)[^()]*\)\)?)

index(\3,\2stepsFrom: \1\4)
2016-03-25 17:54:39 -07:00
Dave Abrahams
8d9e62b274 [stdlib] indexing model: rename next/previous
I'm not too satisfied with the names for the updating: versions, but
this is a start.
2016-03-22 17:13:54 -07:00
Dmitri Gribenko
941235c25e New indexing model: remove a duplicate API 2016-03-18 23:03:19 -07:00
Dmitri Gribenko
3cde854287 Merge remote-tracking branch 'origin/master' into swift-3-indexing-model 2016-03-12 01:11:32 -08:00
Daniel Duan
276370b599 [stdlib] apply SE-0040 to stdlib 2016-03-11 16:01:41 -08:00
Shawn Erickson
175c3cd136 dealt with issues and suggestions outlined in PR1559 2016-03-06 22:13:18 -08:00
Shawn Erickson
0db3a29987 fleshing out Collection.next(Index)
-removed fatal stub Collection.next(Index)
-added default Collection.next(Index) where Index is Strideable
-added custom next(Index) on some collections
-added fatal stub next(Index) on some collections
2016-03-06 17:37:40 -08:00
Dmitri Gribenko
fc636b94f5 fixup 2016-03-06 02:12:59 -08:00
Jordan Rose
0205191e32 stdlib: SequenceType._initializeTo(_:) becomes _copyContents(initializing:) 2016-02-23 16:58:49 -08:00
Dmitri Gribenko
f0633ce5a9 stdlib: Sequence.iterator() => .makeIterator() 2016-02-23 13:52:30 -08:00
Max Moiseev
52f0cf49b0 [stdlib] indexOf => index(of:)/index(where:) 2016-02-23 11:45:11 -08:00
Max Moiseev
78ba5d5f3f [stdlib] Requires in comments changed to Precondition 2016-02-19 18:57:26 -08:00
Dmitri Gribenko
9293c1f5cc stdlib: fix coding style 2016-02-18 22:30:58 -08:00
Dmitri Gribenko
dd75aed67a Merge remote-tracking branch 'origin/master' into swift-3-api-guidelines 2016-02-17 14:40:05 -08:00
Nate Cook
51251dc133 Convert imperative function summaries to present.
i.e., "Return ..." -> "Returns ..."
2016-02-12 04:20:39 -06:00
Nate Cook
f3c4e0ac74 Remove style on *generator* and friends. 2016-02-12 04:20:01 -06:00
Max Moiseev
61c837209b Merge remote-tracking branch 'origin/master' into swift-3-api-guidelines 2016-02-04 16:13:39 -08:00
practicalswift
ca9e488f30 [gardening] Add "-*- swift -*-" to *.swift.gyb. Remove from *.swift. 2016-01-23 10:27:03 +01:00
Dmitri Gribenko
9bcd5a1056 Collection.length => .count 2016-01-22 18:41:19 -08:00
Max Moiseev
86680ec622 [stdlib] @available attributes for removed APIs 2016-01-20 13:08:27 -08:00
Doug Gregor
7d70b704e4 Merge commit '5e11e3f7287427d386636a169c4065c0373931a8' into swift-3-api-guidelines 2016-01-19 23:18:20 -08:00
gregomni
e2dee6b9dd [stdlib] Switch keywords from 'typealias' to 'associatedtype' in stdlib
Fixes deprecation warnings arising from addition of new
‘associatedtype’ keyword in sr-511.
2016-01-14 09:39:15 -08:00
Max Moiseev
f51e708a8f Merge remote-tracking branch 'origin/master' into swift-3-api-guidelines 2016-01-04 12:25:25 -08:00