Skip to content

Commit 6e3f96b

Browse files
committed
Move ClassTagIterableFactory.iterate up
Move ClassTagIterableFactory.iterate up to EvidenceIterableFactory.
1 parent 55d550a commit 6e3f96b

File tree

1 file changed

+9
-9
lines changed

1 file changed

+9
-9
lines changed

src/library/scala/collection/Factory.scala

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -420,6 +420,15 @@ trait EvidenceIterableFactory[+CC[_], Ev[_]] extends Serializable {
420420
*/
421421
def tabulate[A : Ev](n: Int)(f: Int => A): CC[A] = from(new View.Tabulate(n)(f))
422422

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+
423432
/** Produces a $coll that uses a function `f` to produce elements of type `A`
424433
* and update an internal state of type `S`.
425434
*
@@ -489,15 +498,6 @@ trait ClassTagIterableFactory[+CC[_]] extends EvidenceIterableFactory[CC, ClassT
489498
@`inline` private[this] implicit def ccClassTag[X]: ClassTag[CC[X]] =
490499
ClassTag.AnyRef.asInstanceOf[ClassTag[CC[X]]] // Good enough for boxed vs primitive arrays
491500

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-
501501
/** Produces a $coll containing a sequence of increasing of integers.
502502
*
503503
* @param start the first element of the $coll

0 commit comments

Comments
 (0)