ben-cohen
e7b668e705
Part the third
2017-12-01 12:40:19 -08:00
Ben Cohen
aacb1edc7d
Constrain AnySubSequence variants of Sequence methods ( #12029 )
2017-10-03 14:17:25 -07:00
Doug Gregor
e5f893bc59
[Sequence] Make Sequence.SubSequence conform to Sequence.
...
Addressed ABI FIXME’s #4 , #5 , #104 and #105 , making Sequence’s
SubSequence conform to Sequence, with the same element type, and for
which the SubSequence of a SubSequence is the same SubSequence.
Fixes SR-318 / rdar://problem/31418206.
2017-10-01 15:08:22 -07:00
Doug Gregor
0793f6c8c5
Revert "[Sequence] Make Sequence.SubSequence conform to Sequence."
...
This reverts commit 7dc8737c9c .
2017-09-14 09:12:56 -07:00
Doug Gregor
7dc8737c9c
[Sequence] Make Sequence.SubSequence conform to Sequence.
...
Addressed ABI FIXME’s #4 , #5 , #104 and #105 , making Sequence’s
SubSequence conform to Sequence, with the same element type, and for
which the SubSequence of a SubSequence is the same SubSequence.
Fixes SR-318 / rdar://problem/31418206.
2017-09-12 06:52:01 -07:00
Maxim Moiseev
ee5fb33656
[stdlib] Remove the Grand Renaming artifacts of Swift 3 era
2017-08-28 15:54:11 -07:00
Károly Lőrentey
5256d774ea
[stdlib] Fix docs on Sequence.Iterator, .Element
2017-06-22 11:40:55 +02:00
Nate Cook
b7af9bfe83
[stdlib] Remove SeeAlso tags
2017-06-13 11:23:51 -05:00
Pavol Vaskovic
f123404f95
Every dot counts. Period.
2017-05-25 00:08:19 +02:00
Pavol Vaskovic
b57aa7c057
Sequence internals with struct instead of class.
...
_DropFirstSequence, _PrefixSequence and _DropWhileSequence as structs.
I turns out we DON’T require reference semantics to keep track of how many elements we've already taken from the underlying sequence.
… that’s taken care of by the underlying sequence, which has to have reference semantics if it needs them.
2017-05-21 08:02:37 +02:00
Max Moiseev
fd2ac31c6e
[stdlib] Adding RangeReplaceable.filter returning Self
...
This overload allows `String.filter` to return a `String`, and not
`[Character]`.
In the other hand, introduction of this overload makes `[123].filter`
somewhat ambiguous in a sence, that the compiler will now prefer an
implementatin from a more concrete protocol, which is less efficient for
arrays, therefore extra work is needed to make sure Array types fallback
to the `Sequence.filter`.
Implements: <rdar://problem/32209927>
2017-05-18 12:24:13 -07:00
Ben Cohen
ea2f64cad2
[stdlib] Add Sequence.Element, change ExpressibleByArrayLiteral.Element to ArrayLiteralElement ( #8990 )
...
* Give Sequence a top-level Element, constrain Iterator to match
* Remove many instances of Iterator.
* Fixed various hard-coded tests
* XFAIL a few tests that need further investigation
* Change assoc type for arrayLiteralConvertible
* Mop up remaining "better expressed as a where clause" warnings
* Fix UnicodeDecoders prototype test
* Fix UIntBuffer
* Fix hard-coded Element identifier in CSDiag
* Fix up more tests
* Account for flatMap changes
2017-05-14 06:33:25 -07:00
Nate Cook
7fa74f590d
[stdlib] Documentation revisions for string + ranges
...
* removing .characters from examples
* beginning new String doc revisions
* improvements to the String Foundation overlay docs
* minor revisions elsewhere
2017-05-13 10:06:05 -05:00
Nate Cook
8c15c72dfa
[stdlib] Minor documentation fixes
...
* Revise `withExtendedLifetime(_:_:)`
* Correct method in UnsafeMutablePointer discussion
* `Sequence.filter(_:)` documentation fixes
2017-04-20 12:23:17 -05:00
swift-ci
3e085fca4b
Merge pull request #7946 from DougGregor/all-conformance-constraint-sources
2017-03-18 01:30:27 -07:00
Doug Gregor
13c4ae0168
[Standard library] Eliminate redundant conformance constraints.
...
Eliminate all of the redundant conformance constraints in the standard
library that were identified by the newly-introduced warning for
redundant, explicitly-specified conformances.
2017-03-17 20:15:09 -10:00
Roman Levenstein
29ad714bb7
Annotate stdlib functions to get a good performance even in resilient mode, when -sil-serialize-all is disabled
...
This commit mostly improves the performance of arrays and ranges.
It does not cover Strings, Dictionaries and Sets yet.
2017-03-16 19:46:11 -07:00
Robert Widmann
81968e21ff
Remove erroneous drop(while:) optimization
...
Calling drop(while: ) after prefix() on a pure Sequence loses the
prefix, because in the internal drop(while: ) override grabs the
underlying base iterator from _PrefixSequence and wraps it in a
_DropWhileSequence.
2017-03-15 17:01:13 -04:00
Jans Pavlovs
aa9efae562
Update map example code
...
Changes deprecated lowercaseString calls to lowercased()
This commit only affects example code provided in comments
2017-02-19 14:19:08 +02:00
Ben Cohen
578a52627a
Merge branch 'master' into se-147
2017-01-07 13:19:15 -08:00
practicalswift
6d1ae2a39c
[gardening] 2016 → 2017
2017-01-06 16:41:22 +01:00
Ben Cohen
fefc2e40df
Migrate _copyContents to be called from UnsafeMutableBufferPointer with checks for overrun.
2017-01-05 11:59:49 -08:00
Ben Cohen
8ca0df6074
Merge pull request #6542 from airspeedswift/who-fixes-the-fixmes
...
[stdlib] Tag a handful of additional issues with FIXME(ABI)
2017-01-04 18:43:04 -08:00
Ben Cohen
28114baeb9
Flag various FIXMEs as ABI-impacting
2017-01-03 18:36:20 -08:00
Yurii Samsoniuk
faa7c749df
Removed repetitive docstring
2016-12-31 15:19:44 +01:00
practicalswift
797b80765f
[gardening] Use the correct base URL ( https://swift.org ) in references to the Swift website
...
Remove all references to the old non-TLS enabled base URL (http://swift.org )
2016-11-20 17:36:03 +01:00
Nate Cook
534bea8f9f
[stdlib] Update revisions with feedback
2016-11-15 15:00:10 -06:00
Nate Cook
bd6025f463
[stdlib] Various documentation fixes
...
- Fix incorrect type in Float(_:String) examples
- Expand discussions for ExpressibleBy_Literal protocols
- Add notes about non-escaping unsafe pointers from closures
- Add note about isEmpty to Collection.count discussions
- Describe imported `Bool` types
- Clean up some floating point discussions
- Provide some additional operator documentation
- Revise documentation for CVarArg functions
- Fix incorrect Set method parameter descriptions
- Clarify array bridging behavior
- Add collection subscript complexity notes
2016-11-11 11:23:49 -06:00
Dave Abrahams
be1f95a65b
[stdlib] Simplify expressions
...
Overload resolution is still slow, so these simple changes make a >10%
difference in compilation time.
2016-10-11 10:07:21 -07:00
airspeedswift
ed5231b47c
Numbered all FIXME(ABI) entries for tracking purposes. ( #4868 )
2016-09-19 16:41:41 -07:00
practicalswift
fa7fbdb8b0
[gardening] Remove redundant nil-initialization of optional variable
...
From the Swift documentation:
"If you define an optional variable without providing a default value,
the variable is automatically set to nil for you."
2016-09-18 07:40:07 +02:00
Dmitri Gribenko
92c180031f
stdlib: make 'Sequence.first(where:)' a pure protocol extension (no dynamic dispatch)
...
SE-0032 did not propose a protocol entry point, only a protocol
extension.
Using a pure protocol extension is the right choice here because a
concrete sequence can't provide a more efficient implementation of this
method than the default one.
2016-09-09 11:30:55 -07:00
Toni Suter
c11ae52e03
Fix wrong parameter name in documentation comment
2016-09-05 16:44:59 +02:00
Robert Widmann
740721ab2f
Address Dmitri's comments on #3600
2016-08-16 23:59:00 -07:00
Robert Widmann
e6c313bce3
Merge pull request #3600 from russbishop/se0045
...
[SR-1516][stdlib] Implement SE-0045 prefix(while:) and drop(while:)
2016-08-16 16:26:21 -07:00
Russ Bishop
f0e6c306e4
[stdlib][SE-45] Add prefix(while:) and drop(while:) to Sequence
...
Includes lazy implementation courtesy of Nate Cook
2016-08-15 14:13:27 -07:00
Rintaro Ishizaki
2a9b78e193
stdlib: Add unavailable declarations for APIs renamed in SE-0118
...
Sequence.sort(_:) => sorted(by:)
Sequence.sort() => sorted()
Sequence.elementsEqual(_:isEquivalent) => elementsEqual(_:by:)
Sequence.contains(_:) => contains(where:)
Sequence reduce(_:combine:) => reduce(_:_:)
UnicodeCodec.encode(_:output:) => encode(_:into:)
ManagedBuffer.create(_:initialValue:)
=> create(minimumCapacity:makingHeaderWith:)
ManagedBufferPointer.init(bufferClass:minimumCapacity:initialValue)
=> init(bufferClass:minimumCapacity:makingHeaderWith:)
2016-08-14 03:28:01 +09:00
Nate Cook
8b39706c3f
[stdlib] Documentation revisions
...
- Various edits
- Standardized complexity formatting
2016-08-12 12:24:36 -05:00
Rintaro Ishizaki
5b8a78473e
stdlib: Fix-it for underestimateCount() renaming
...
underestimateCount() has been replaced by underestimatedCount property.
2016-08-09 21:00:33 +09:00
Nate Cook
559092bbf2
[stdlib] Revise stdlib documentation comments
...
- Expand pre-example explanations
- Update documentation for SE-0118
- Removing remaining 'iff' usage
- Revise Array discussion
- Fix formIndex(_:offsetBy) parameter formatting
- Improve index/formIndex(_:offsetBy:(limitedBy:)?) discussion
- Update Quick Look discussions
- Fixes grammar inconsistencies
- Adds parameter / return documentation
- Adds and expands on examples
- Revises AnyObject discussion for new `id` bridging rules
- Revise readLine, print, and assertion functions
- Add missing docs to String index-moving methods
2016-08-05 16:07:46 -05:00
Michael Ilseman
b7c9eddd11
[noescape by default] drop @noescape from stdlib
2016-08-04 16:09:01 -07:00
Jacob Bandes-Storch
301c0688dc
Merge branch 'master' into se-0133
2016-07-28 11:46:03 -07:00
Nate Cook
58fb4ef9c5
[stdlib] Clean up various documentation issues ( #3804 )
...
* [stdlib] Clean up some documentation formatting
* [stdlib] Update example code for SE-0103
* [stdlib] Fix UnsafeBufferPointer documentation typo
* [stdlib] Collection documentation cleanup
* [stdlib] Fix String.init?(_:UTF16View) description
* [stdlib] Documentation fixes for SE-0091
* [stdlib] Add param info for String(repeating:count:)
2016-07-28 11:25:38 -07:00
Jacob Bandes-Storch
039ad2bf09
[stdlib] Rename flatten() to joined() (SE-0133)
2016-07-27 23:19:31 -07:00
Dave Abrahams
4fa5877f4f
[stdlib] Fix some examples in doc comments
2016-07-19 14:44:25 -07:00
Dave Abrahams
b2bbd4c599
reduce(_ initial:combine:) => reduce(_ initialResult:_ nextPartialResult)
2016-07-19 07:12:59 -06:00
Dave Abrahams
5a5f19aa45
first/contains(predicate) => first/contains(where: predicate)
2016-07-19 07:12:59 -06:00
Dave Abrahams
dcbfdb5339
_ includeElement/whereElementsSatisfy predicate => _ isIncluded
2016-07-19 07:05:54 -06:00
Dave Abrahams
4b072f630c
_ isSeparator: => whereSeparator isSeparator:
2016-07-19 07:05:53 -06:00
Andrew Trick
73106dd7c3
Rename initialize(with:count:) to initialize(to:count:). ( #3601 )
...
As proposed in SE-0107: UnsafeRawPointer.
"with" is considered a vacuous preposition. "to" implies direction.
2016-07-18 23:37:45 -07:00