Commit Graph

30 Commits

Author SHA1 Message Date
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
Michael Ilseman
ccda8f33d1 [noescape by default] Proliferate @escaping
Adds an explicit @escaping throughout the standard library, validation
test suite, and tests. This will be necessary as soon as noescape is
the default for closure parameters.
2016-07-29 13:48:07 -07:00
Jacob Bandes-Storch
039ad2bf09 [stdlib] Rename flatten() to joined() (SE-0133) 2016-07-27 23:19:31 -07:00
Rintaro Ishizaki
668b9dbc64 [stdlib] Apply tail style "where" clause to stdlib/public/core 2016-06-02 12:00:55 +09:00
Dmitri Gribenko
d591f9cf7a stdlib: remove most uses of @warn_unused_result, which does nothing now
I kept the one on sorted(), because that one requires a less trivial
change.
2016-05-19 18:39:39 -07:00
Russ Bishop
7dc71d0d96 Rename generic arguments 2016-05-11 13:44:37 -07:00
Russ Bishop
b7329df146 Cleanup comments for flatMap overloads 2016-05-11 00:27:59 -07:00
Russ Bishop
408e8c738b Remove RandomAccess overloads and types 2016-05-11 00:27:59 -07:00
Russ Bishop
1afa93b646 [stdlib] SR-361: Implement SE008: Add Lazy flatMap for Seq of Optionals
https://bugs.swift.org/browse/SR-361

Adds required LazyFilterRandomAccessCollection and the flatMap extensions.
2016-05-10 02:42:57 -07:00
Dmitri Gribenko
10697f939f Merge commit '510f29abf77e202780c11d5f6c7449313c819030' into swift-3-indexing-model 2016-04-14 13:45:27 -07:00
Manav Gabhawala
7928140f79 [SE-0046] Implements consistent function parameter labels by discarding extraneous parameter names and adding _ where necessary 2016-04-06 20:21:58 -04:00
Dmitri Gribenko
955f4144be New indexing model: fix lazy flatMap() 2016-03-09 20:41:58 -08:00
Dmitri Gribenko
ad1428e1d6 New collection indexing model: removed old index protocols
... and started to fix compiler errors.
2016-03-06 01:53:34 -08:00
Max Moiseev
f51e708a8f Merge remote-tracking branch 'origin/master' into swift-3-api-guidelines 2016-01-04 12:25:25 -08:00
Zach Panzarino
e3a4147ac9 Update copyright date 2015-12-31 23:28:40 +00:00
ken0nek
e7e70cea92 Add spaces before and after closure arrow in stdlib 2015-12-23 04:52:15 +09:00
Dmitri Gribenko
156d29a2af flatMap(): generic type parameter Intermediate => SegmentOfResult 2015-12-17 17:07:21 -08:00
Maxim Moiseev
6b7fc91beb LazySequenceType => LazySequenceProtocol 2015-12-10 17:00:08 -08:00
Maxim Moiseev
844b81c46b SequenceType => Sequence 2015-12-09 17:16:56 -08:00
Maxim Moiseev
c678a839dc IndexType => Index 2015-12-09 17:16:42 -08:00
Maxim Moiseev
01e1a7bd52 LazyCollectionType => LazyCollectionProtocol 2015-12-09 17:16:22 -08:00
Maxim Moiseev
7e2466c14e CollectionType => Collection 2015-12-09 17:12:48 -08:00
Dmitri Gribenko
2cf172160c Rename SequenceType.Generator associated type to SequenceType.Iterator 2015-12-09 17:11:05 -08:00
Dave Abrahams
ad43a596bd [stdlib] Retire the old lazy subsystem...
...replacing it with the new, after passing API review!

* The lazy free function has become a property.

* Before we could extend protocols, we lacked a means for value types to
  share implementations, and each new lazy algorithm had to be added to
  each of up to four types: LazySequence, LazyForwardCollection,
  LazyBidirectionalCollection, and LazyRandomAccessCollection. These
  generic adapters hid the usual algorithms by defining their own
  versions that returned new lazy generic adapters. Now users can extend
  just one of two protocols to do the same thing: LazySequenceType or
  LazyCollectionType.

* To avoid making the code duplication worse than it already was, the
  generic adapters mentioned above were used to add the lazy generic
  algorithms around simpler adapters such as MapSequence that just
  provided the basic requirements of SequenceType by applying a
  transformation to some base sequence, resulting in deeply nested
  generic types as shown here. Now, MapSequence is an instance of
  LazySequenceType (and is renamed LazyMapSequence), and thus transmits
  laziness to its algorithms automatically.

* Documentation comments have been rewritten.

* The .array property was retired

* various renamings

* A bunch of Gyb files were retired.

Swift SVN r30902
2015-08-01 03:52:13 +00:00
David Farler
7a49dda2c8 Add @warn_unused_result to map, flatMap, and filter
rdar://problem/21971932

Swift SVN r30849
2015-07-31 05:15:10 +00:00
Dave Abrahams
f37d607a13 Revert "stdlib: remove FlattenCollection -- it does not model CollectionType properly."
Actually we hadn't nailed down the indexing model sufficiently; now we
have.

This reverts r30617.

Swift SVN r30694
2015-07-27 19:33:15 +00:00
Dmitri Hrybenko
78222237e0 stdlib: remove FlattenCollection -- it does not model CollectionType properly.
An index of a FlattenCollection is composed of two: an index to the
current chunk and an index within that chunk.  So you take the
startIndex, and advance it to the second chunk; call the result idx1.
You take startIndex again, and advance it the same number of steps; call
the result idx2:

let idx1 = flatMapCollection.startIndex.advancedBy(10)
let idx2 = flatMapCollection.startIndex.advancedBy(10)

idx1 and idx2 have to compare equal according to collection and index
axioms.  But this can't be cheaply implemented.  Every index contains an
index into the inner collection.  So indices into two collections with
the same elements have to compare equal even though the collections
don't have any common history, they were merely created using the same
sequence of steps.

What currently happens is that you get random results depending on the
underlying collection kind.

rdar://21989896

Swift SVN r30617
2015-07-25 02:18:13 +00:00
Dave Abrahams
b184e6df59 [stdlib] Document complexity of flatMaps
Swift SVN r30470
2015-07-21 22:35:38 +00:00
Dave Abrahams
2088a71259 [stdlib] Document the lazy flatMaps
Swift SVN r30467
2015-07-21 22:01:24 +00:00
Dave Abrahams
03f879bb87 [stdlib] Lazy flatMap
Addresses <rdar://problem/20138472>, can close after API review.

Swift SVN r30370
2015-07-18 06:50:27 +00:00