@@ -420,6 +420,15 @@ trait EvidenceIterableFactory[+CC[_], Ev[_]] extends Serializable {
420
420
*/
421
421
def tabulate [A : Ev ](n : Int )(f : Int => A ): CC [A ] = from(new View .Tabulate (n)(f))
422
422
423
+ /** Produces a $coll containing repeated applications of a function to a start value.
424
+ *
425
+ * @param start the start value of the $coll
426
+ * @param len the number of elements contained in the $coll
427
+ * @param f the function that's repeatedly applied
428
+ * @return a $coll with `len` values in the sequence `start, f(start), f(f(start)), ...`
429
+ */
430
+ def iterate [A : Ev ](start : A , len : Int )(f : A => A ): CC [A ] = from(new View .Iterate (start, len)(f))
431
+
423
432
/** Produces a $coll that uses a function `f` to produce elements of type `A`
424
433
* and update an internal state of type `S`.
425
434
*
@@ -489,15 +498,6 @@ trait ClassTagIterableFactory[+CC[_]] extends EvidenceIterableFactory[CC, ClassT
489
498
@ `inline` private [this ] implicit def ccClassTag [X ]: ClassTag [CC [X ]] =
490
499
ClassTag .AnyRef .asInstanceOf [ClassTag [CC [X ]]] // Good enough for boxed vs primitive arrays
491
500
492
- /** Produces a $coll containing repeated applications of a function to a start value.
493
- *
494
- * @param start the start value of the $coll
495
- * @param len the number of elements contained in the $coll
496
- * @param f the function that's repeatedly applied
497
- * @return a $coll with `len` values in the sequence `start, f(start), f(f(start)), ...`
498
- */
499
- def iterate [A : ClassTag ](start : A , len : Int )(f : A => A ): CC [A ] = from(new View .Iterate (start, len)(f))
500
-
501
501
/** Produces a $coll containing a sequence of increasing of integers.
502
502
*
503
503
* @param start the first element of the $coll
0 commit comments