|
10 | 10 | //
|
11 | 11 | //===----------------------------------------------------------------------===//
|
12 | 12 |
|
13 |
| -/// Returns the minimum element in `elements`. |
14 |
| -/// |
15 |
| -/// - Requires: `elements` is non-empty. O(`elements.count`). |
16 |
| -@available(*, unavailable, message="call the 'minElement()' method on the sequence") |
17 |
| -public func minElement< |
18 |
| - R : SequenceType |
19 |
| - where R.Generator.Element : Comparable>(elements: R) |
20 |
| - -> R.Generator.Element { |
21 |
| - fatalError("unavailable function can't be called") |
22 |
| -} |
23 |
| - |
24 |
| -/// Returns the maximum element in `elements`. |
25 |
| -/// |
26 |
| -/// - Requires: `elements` is non-empty. O(`elements.count`). |
27 |
| -@available(*, unavailable, message="call the 'maxElement()' method on the sequence") |
28 |
| -public func maxElement< |
29 |
| - R : SequenceType |
30 |
| - where R.Generator.Element : Comparable>(elements: R) |
31 |
| - -> R.Generator.Element { |
32 |
| - fatalError("unavailable function can't be called") |
33 |
| -} |
34 |
| - |
35 |
| -/// Returns the first index where `value` appears in `domain` or `nil` if |
36 |
| -/// `value` is not found. |
37 |
| -/// |
38 |
| -/// - Complexity: O(`domain.count`). |
39 |
| -@available(*, unavailable, message="call the 'indexOf()' method on the collection") |
40 |
| -public func find< |
41 |
| - C: CollectionType where C.Generator.Element : Equatable |
42 |
| ->(domain: C, _ value: C.Generator.Element) -> C.Index? { |
43 |
| - fatalError("unavailable function can't be called") |
44 |
| -} |
45 |
| - |
46 | 13 | /// Returns the lesser of `x` and `y`.
|
47 | 14 | @warn_unused_result
|
48 | 15 | public func min<T : Comparable>(x: T, _ y: T) -> T {
|
@@ -99,53 +66,6 @@ public func max<T : Comparable>(x: T, _ y: T, _ z: T, _ rest: T...) -> T {
|
99 | 66 | return r
|
100 | 67 | }
|
101 | 68 |
|
102 |
| -/// Returns the result of slicing `elements` into sub-sequences that |
103 |
| -/// don't contain elements satisfying the predicate `isSeparator`. |
104 |
| -/// |
105 |
| -/// - parameter maxSplit: The maximum number of slices to return, minus 1. |
106 |
| -/// If `maxSplit + 1` slices would otherwise be returned, the |
107 |
| -/// algorithm stops splitting and returns a suffix of `elements`. |
108 |
| -/// |
109 |
| -/// - parameter allowEmptySlices: If `true`, an empty slice is produced in |
110 |
| -/// the result for each pair of consecutive. |
111 |
| -@available(*, unavailable, message="Use the split() method instead.") |
112 |
| -public func split<S : CollectionType, R : BooleanType>( |
113 |
| - elements: S, |
114 |
| - maxSplit: Int = Int.max, |
115 |
| - allowEmptySlices: Bool = false, |
116 |
| - @noescape isSeparator: (S.Generator.Element) -> R |
117 |
| - ) -> [S.SubSequence] { |
118 |
| - fatalError("unavailable function can't be called") |
119 |
| -} |
120 |
| - |
121 |
| -/// Returns `true` iff the the initial elements of `s` are equal to `prefix`. |
122 |
| -@available(*, unavailable, message="call the 'startsWith()' method on the sequence") |
123 |
| -public func startsWith< |
124 |
| - S0 : SequenceType, S1 : SequenceType |
125 |
| - where |
126 |
| - S0.Generator.Element == S1.Generator.Element, |
127 |
| - S0.Generator.Element : Equatable |
128 |
| ->(s: S0, _ prefix: S1) -> Bool |
129 |
| -{ |
130 |
| - fatalError("unavailable function can't be called") |
131 |
| -} |
132 |
| - |
133 |
| -/// Returns `true` iff `s` begins with elements equivalent to those of |
134 |
| -/// `prefix`, using `isEquivalent` as the equivalence test. |
135 |
| -/// |
136 |
| -/// - Requires: `isEquivalent` is an [equivalence relation](http://en.wikipedia.org/wiki/Equivalence_relation). |
137 |
| -@available(*, unavailable, message="call the 'startsWith()' method on the sequence") |
138 |
| -public func startsWith< |
139 |
| - S0 : SequenceType, S1 : SequenceType |
140 |
| - where |
141 |
| - S0.Generator.Element == S1.Generator.Element |
142 |
| ->(s: S0, _ prefix: S1, |
143 |
| - @noescape _ isEquivalent: (S1.Generator.Element, S1.Generator.Element) -> Bool) |
144 |
| - -> Bool |
145 |
| -{ |
146 |
| - fatalError("unavailable function can't be called") |
147 |
| -} |
148 |
| - |
149 | 69 | /// The `GeneratorType` for `EnumerateSequence`. `EnumerateGenerator`
|
150 | 70 | /// wraps a `Base` `GeneratorType` and yields successive `Int` values,
|
151 | 71 | /// starting at zero, along with the elements of the underlying
|
@@ -209,105 +129,3 @@ public struct EnumerateSequence<Base : SequenceType> : SequenceType {
|
209 | 129 | }
|
210 | 130 | }
|
211 | 131 |
|
212 |
| -/// Returns a lazy `SequenceType` containing pairs (*n*, *x*), where |
213 |
| -/// *n*s are consecutive `Int`s starting at zero, and *x*s are |
214 |
| -/// the elements of `base`: |
215 |
| -/// |
216 |
| -/// > for (n, c) in enumerate("Swift".characters) { |
217 |
| -/// print("\(n): '\(c)'" ) |
218 |
| -/// } |
219 |
| -/// 0: 'S' |
220 |
| -/// 1: 'w' |
221 |
| -/// 2: 'i' |
222 |
| -/// 3: 'f' |
223 |
| -/// 4: 't' |
224 |
| -@available(*, unavailable, message="call the 'enumerate()' method on the sequence") |
225 |
| -public func enumerate<Seq : SequenceType>( |
226 |
| - base: Seq |
227 |
| -) -> EnumerateSequence<Seq> { |
228 |
| - fatalError("unavailable function can't be called") |
229 |
| -} |
230 |
| - |
231 |
| -/// Returns `true` iff `a1` and `a2` contain the same elements in the |
232 |
| -/// same order. |
233 |
| -@available(*, unavailable, message="call the 'equalElements()' method on the sequence") |
234 |
| -public func equal< |
235 |
| - S1 : SequenceType, S2 : SequenceType |
236 |
| - where |
237 |
| - S1.Generator.Element == S2.Generator.Element, |
238 |
| - S1.Generator.Element : Equatable |
239 |
| ->(a1: S1, _ a2: S2) -> Bool { |
240 |
| - fatalError("unavailable function can't be called") |
241 |
| -} |
242 |
| - |
243 |
| -/// Returns `true` iff `a1` and `a2` contain equivalent elements, using |
244 |
| -/// `isEquivalent` as the equivalence test. |
245 |
| -/// |
246 |
| -/// - Requires: `isEquivalent` is an [equivalence relation](http://en.wikipedia.org/wiki/Equivalence_relation). |
247 |
| -@available(*, unavailable, message="call the 'equalElements()' method on the sequence") |
248 |
| -public func equal< |
249 |
| - S1 : SequenceType, S2 : SequenceType |
250 |
| - where |
251 |
| - S1.Generator.Element == S2.Generator.Element |
252 |
| ->(a1: S1, _ a2: S2, |
253 |
| - @noescape _ isEquivalent: (S1.Generator.Element, S1.Generator.Element) -> Bool) |
254 |
| - -> Bool { |
255 |
| - fatalError("unavailable function can't be called") |
256 |
| -} |
257 |
| - |
258 |
| -/// Returns `true` iff `a1` precedes `a2` in a lexicographical ("dictionary") |
259 |
| -/// ordering, using "<" as the comparison between elements. |
260 |
| -@available(*, unavailable, message="call the 'lexicographicalCompare()' method on the sequence") |
261 |
| -public func lexicographicalCompare< |
262 |
| - S1 : SequenceType, S2 : SequenceType |
263 |
| - where |
264 |
| - S1.Generator.Element == S2.Generator.Element, |
265 |
| - S1.Generator.Element : Comparable>( |
266 |
| - a1: S1, _ a2: S2) -> Bool { |
267 |
| - fatalError("unavailable function can't be called") |
268 |
| -} |
269 |
| - |
270 |
| -/// Returns `true` iff `a1` precedes `a2` in a lexicographical ("dictionary") |
271 |
| -/// ordering, using `isOrderedBefore` as the comparison between elements. |
272 |
| -/// |
273 |
| -/// - Requires: `isOrderedBefore` is a |
274 |
| -/// [strict weak ordering](http://en.wikipedia.org/wiki/Strict_weak_order#Strict_weak_orderings) |
275 |
| -/// over the elements of `a1` and `a2`. |
276 |
| -@available(*, unavailable, message="call the 'lexicographicalCompare()' method on the sequence") |
277 |
| -public func lexicographicalCompare< |
278 |
| - S1 : SequenceType, S2 : SequenceType |
279 |
| - where |
280 |
| - S1.Generator.Element == S2.Generator.Element |
281 |
| ->( |
282 |
| - a1: S1, _ a2: S2, |
283 |
| - @noescape isOrderedBefore less: (S1.Generator.Element, S1.Generator.Element) |
284 |
| - -> Bool |
285 |
| -) -> Bool { |
286 |
| - fatalError("unavailable function can't be called") |
287 |
| -} |
288 |
| - |
289 |
| -/// Returns `true` iff an element in `seq` satisfies `predicate`. |
290 |
| -@available(*, unavailable, message="call the 'contains()' method on the sequence") |
291 |
| -public func contains< |
292 |
| - S : SequenceType, L : BooleanType |
293 |
| ->(seq: S, @noescape _ predicate: (S.Generator.Element) -> L) -> Bool { |
294 |
| - fatalError("unavailable function can't be called") |
295 |
| -} |
296 |
| - |
297 |
| -/// Returns `true` iff `x` is in `seq`. |
298 |
| -@available(*, unavailable, message="call the 'contains()' method on the sequence") |
299 |
| -public func contains< |
300 |
| - S : SequenceType where S.Generator.Element : Equatable |
301 |
| ->(seq: S, _ x: S.Generator.Element) -> Bool { |
302 |
| - fatalError("unavailable function can't be called") |
303 |
| -} |
304 |
| - |
305 |
| -/// Returns the result of repeatedly calling `combine` with an |
306 |
| -/// accumulated value initialized to `initial` and each element of |
307 |
| -/// `sequence`, in turn. |
308 |
| -@available(*, unavailable, message="call the 'reduce()' method on the sequence") |
309 |
| -public func reduce<S : SequenceType, U>( |
310 |
| - sequence: S, _ initial: U, @noescape _ combine: (U, S.Generator.Element) -> U |
311 |
| -) -> U { |
312 |
| - fatalError("unavailable function can't be called") |
313 |
| -} |
0 commit comments