From e8911261fa8649c19eb435fd95512657b632852c Mon Sep 17 00:00:00 2001 From: Erik van Oosten Date: Wed, 23 Oct 2019 14:32:33 +0200 Subject: [PATCH 1/6] Documentation and tests for Iterator.intersperse. --- .../decorators/IteratorDecorator.scala | 32 +++++++++++++++++++ .../decorators/IteratorDecoratorTest.scala | 17 ++++++++++ 2 files changed, 49 insertions(+) diff --git a/src/main/scala/scala/collection/decorators/IteratorDecorator.scala b/src/main/scala/scala/collection/decorators/IteratorDecorator.scala index caba75d..9f7b2ea 100644 --- a/src/main/scala/scala/collection/decorators/IteratorDecorator.scala +++ b/src/main/scala/scala/collection/decorators/IteratorDecorator.scala @@ -5,6 +5,19 @@ import scala.annotation.tailrec class IteratorDecorator[A](val `this`: Iterator[A]) extends AnyVal { + /** + * Inserts a separator value between each item. + * + * {{{ + * Iterator(1, 2, 3).intersperse(0) === Iterator(1, 0, 2, 0, 3) + * Iterator('a', 'b', 'c').intersperse(',') === Iterator('a', ',', 'b', ',', 'c') + * Iterator('a').intersperse(',') === Iterator('a') + * Iterator().intersperse(',') === Iterator() + * }}} + * + * @param sep the separator value. + * @return The resulting iterator contains all items from the source iterator, separated by the `sep` value. + */ def intersperse[B >: A](sep: B): Iterator[B] = new Iterator[B] { var intersperseNext = false override def hasNext = intersperseNext || `this`.hasNext @@ -15,6 +28,25 @@ class IteratorDecorator[A](val `this`: Iterator[A]) extends AnyVal { } } + /** + * Inserts a start value at the start of the iterator, a separator value between each item, and + * an end value at the end of the iterator. + * + * {{{ + * Iterator(1, 2, 3).intersperse(-1, 0, 99) === Iterator(-1, 1, 0, 2, 0, 3, 99) + * Iterator('a', 'b', 'c').intersperse('[', ',', ']') === Iterator('[', 'a', ',', 'b', ',', 'c', ']') + * Iterator('a').intersperse('[', ',', ']') === Iterator('[', 'a', ']') + * Iterator().intersperse('[', ',', ']') === Iterator('[', ']') + * }}} + * + * @param start the starting value. + * @param sep the separator value. + * @param end the ending value. + * @return The resulting iterator + * begins with the `start` value and ends with the `end` value. + * Inside, are all items from the source iterator separated by + * the `sep` value. + */ def intersperse[B >: A](start: B, sep: B, end: B): Iterator[B] = new Iterator[B] { var started = false var finished = false diff --git a/src/test/scala/scala/collection/decorators/IteratorDecoratorTest.scala b/src/test/scala/scala/collection/decorators/IteratorDecoratorTest.scala index 08d93fc..b4e9df4 100644 --- a/src/test/scala/scala/collection/decorators/IteratorDecoratorTest.scala +++ b/src/test/scala/scala/collection/decorators/IteratorDecoratorTest.scala @@ -6,6 +6,23 @@ import org.junit.{Assert, Test} import scala.util.Try class IteratorDecoratorTest { + @Test + def intersperseShouldIntersperseASeparator(): Unit = { + Assert.assertEquals(Iterator(1, 2, 3).intersperse(0).toSeq, Seq(1, 0, 2, 0, 3)) + Assert.assertEquals(Iterator('a', 'b', 'c').intersperse(',').toSeq, Seq('a', ',', 'b', ',', 'c')) + Assert.assertEquals(Iterator('a').intersperse(',').toSeq, Seq('a')) + Assert.assertEquals(Iterator().intersperse(',').toSeq, Seq.empty) + } + + @Test + def intersperseShouldIntersperseASeparatorAndInsertStartAndEnd(): Unit = { + Assert.assertEquals(Iterator(1, 2, 3).intersperse(-1, 0, 99).toSeq, Seq(-1, 1, 0, 2, 0, 3, 99)) + Assert.assertEquals(Iterator('a', 'b', 'c').intersperse('[', ',', ']').toSeq, + Seq('[', 'a', ',', 'b', ',', 'c', ']')) + Assert.assertEquals(Iterator('a').intersperse('[', ',', ']').toSeq, Seq('[', 'a', ']')) + Assert.assertEquals(Iterator().intersperse('[', ',', ']').toSeq, Seq('[', ']')) + } + @Test def splitByShouldHonorEmptyIterator(): Unit = { val groupedIterator = Iterator.empty.splitBy(identity) From 666019c5cfcb4a8b908578288fd6031bcc357d77 Mon Sep 17 00:00:00 2001 From: Erik van Oosten Date: Thu, 24 Oct 2019 21:03:19 +0200 Subject: [PATCH 2/6] Added some missing scala-doc and unit tests for `IteratorDecorator`. Corrected order of arguments to assertEquals. --- .../decorators/IteratorDecorator.scala | 61 ++++++++---- .../decorators/IteratorDecoratorTest.scala | 96 +++++++++++++++---- 2 files changed, 121 insertions(+), 36 deletions(-) diff --git a/src/main/scala/scala/collection/decorators/IteratorDecorator.scala b/src/main/scala/scala/collection/decorators/IteratorDecorator.scala index 9f7b2ea..4677462 100644 --- a/src/main/scala/scala/collection/decorators/IteratorDecorator.scala +++ b/src/main/scala/scala/collection/decorators/IteratorDecorator.scala @@ -6,7 +6,7 @@ import scala.annotation.tailrec class IteratorDecorator[A](val `this`: Iterator[A]) extends AnyVal { /** - * Inserts a separator value between each item. + * Inserts a separator value between each element. * * {{{ * Iterator(1, 2, 3).intersperse(0) === Iterator(1, 0, 2, 0, 3) @@ -16,7 +16,8 @@ class IteratorDecorator[A](val `this`: Iterator[A]) extends AnyVal { * }}} * * @param sep the separator value. - * @return The resulting iterator contains all items from the source iterator, separated by the `sep` value. + * @return The resulting iterator contains all elements from the source iterator, separated by the `sep` value. + * @note Reuse: $consumesIterator */ def intersperse[B >: A](sep: B): Iterator[B] = new Iterator[B] { var intersperseNext = false @@ -29,7 +30,7 @@ class IteratorDecorator[A](val `this`: Iterator[A]) extends AnyVal { } /** - * Inserts a start value at the start of the iterator, a separator value between each item, and + * Inserts a start value at the start of the iterator, a separator value between each element, and * an end value at the end of the iterator. * * {{{ @@ -44,8 +45,9 @@ class IteratorDecorator[A](val `this`: Iterator[A]) extends AnyVal { * @param end the ending value. * @return The resulting iterator * begins with the `start` value and ends with the `end` value. - * Inside, are all items from the source iterator separated by + * Inside, are all elements from the source iterator separated by * the `sep` value. + * @note Reuse: $consumesIterator */ def intersperse[B >: A](start: B, sep: B, end: B): Iterator[B] = new Iterator[B] { var started = false @@ -73,6 +75,26 @@ class IteratorDecorator[A](val `this`: Iterator[A]) extends AnyVal { } } + /** + * Folds elements with combination function `op` until + * all elements have been processed, or `op` returns `None`. + * $mayNotTerminateInf + * + * {{{ + * def sumOp(acc: Int, e: Int): Option[Int] = if (e == 4) None else Some(acc + e) + * Iterator.empty.foldSomeLeft(0)(sumOp) === 0 + * Iterator(1, 2, 3).foldSomeLeft(0)(sumOp) === 6 + * Iterator(1, 2, 3, 4, 5).foldSomeLeft(0)(sumOp) === 6 + * }}} + * + * @param z the start value + * @param op the binary operator + * @tparam B the result type of the binary operator + * @return the result of evaluating `op` on the previous result of `op` (or `z` for the first time) and + * elements of the source iterator, stopping when all the elements have been + * iterated or earlier when `op` returns `None` + * @note Reuse: $consumesIterator + */ def foldSomeLeft[B](z: B)(op: (B, A) => Option[B]): B = { var result: B = z while (`this`.hasNext) { @@ -84,6 +106,10 @@ class IteratorDecorator[A](val `this`: Iterator[A]) extends AnyVal { result } + /** + * $mayNotTerminateInf + * @note Reuse: $consumesIterator + */ def lazyFoldLeft[B](z: B)(op: (B, => A) => B): B = { var result = z var finished = false @@ -98,6 +124,10 @@ class IteratorDecorator[A](val `this`: Iterator[A]) extends AnyVal { result } + /** + * $mayNotTerminateInf + * @note Reuse: $consumesIterator + */ def lazyFoldRight[B](z: B)(op: A => Either[B, B => B]): B = { def chainEval(x: B, fs: immutable.List[B => B]): B = @@ -119,26 +149,19 @@ class IteratorDecorator[A](val `this`: Iterator[A]) extends AnyVal { } /** - * Constructs an iterator where consecutive elements are accumulated as - * long as the output of f for each element doesn't change. - *
-    * Vector(1,2,2,3,3,3,2,2)
-    * .iterator
-    * .splitBy(identity)
-    * .toList
-    * 
- * produces - *
-    * List(Seq(1),
-    * Seq(2,2),
-    * Seq(3,3,3),
-    * Seq(2,2))
-    * 
+ * Constructs an iterator in which each element is a the sequence of accumulated elements + * from the source iterator that have the same key, where the key is calculated by `f`. + * + * {{{ + * Iterator(1,2,2,3,3,3,2,2).splitBy(identity) === Iterator(Seq(1), Seq(2,2), Seq(3,3,3), Seq(2,2)) + * Iterator((1,1), (1,2), (2, 3)).splitBy(_._1) === Iterator(Seq((1,1), (1,2)), Seq((2,3))) + * }}} * * @param f the function to compute a key for an element * @tparam K the type of the computed key * @return an iterator of sequences of the consecutive elements with the * same key in the original iterator + * @note Reuse: $consumesIterator */ def splitBy[K](f: A => K): Iterator[immutable.Seq[A]] = new AbstractIterator[immutable.Seq[A]] { diff --git a/src/test/scala/scala/collection/decorators/IteratorDecoratorTest.scala b/src/test/scala/scala/collection/decorators/IteratorDecoratorTest.scala index b4e9df4..b435004 100644 --- a/src/test/scala/scala/collection/decorators/IteratorDecoratorTest.scala +++ b/src/test/scala/scala/collection/decorators/IteratorDecoratorTest.scala @@ -8,26 +8,79 @@ import scala.util.Try class IteratorDecoratorTest { @Test def intersperseShouldIntersperseASeparator(): Unit = { - Assert.assertEquals(Iterator(1, 2, 3).intersperse(0).toSeq, Seq(1, 0, 2, 0, 3)) - Assert.assertEquals(Iterator('a', 'b', 'c').intersperse(',').toSeq, Seq('a', ',', 'b', ',', 'c')) - Assert.assertEquals(Iterator('a').intersperse(',').toSeq, Seq('a')) - Assert.assertEquals(Iterator().intersperse(',').toSeq, Seq.empty) + Assert.assertEquals(Seq(1, 0, 2, 0, 3), Iterator(1, 2, 3).intersperse(0).toSeq) + Assert.assertEquals(Seq('a', ',', 'b', ',', 'c'), Iterator('a', 'b', 'c').intersperse(',').toSeq) + Assert.assertEquals(Seq('a'), Iterator('a').intersperse(',').toSeq) + Assert.assertEquals(Seq.empty, Iterator().intersperse(',').toSeq) } @Test def intersperseShouldIntersperseASeparatorAndInsertStartAndEnd(): Unit = { - Assert.assertEquals(Iterator(1, 2, 3).intersperse(-1, 0, 99).toSeq, Seq(-1, 1, 0, 2, 0, 3, 99)) - Assert.assertEquals(Iterator('a', 'b', 'c').intersperse('[', ',', ']').toSeq, - Seq('[', 'a', ',', 'b', ',', 'c', ']')) - Assert.assertEquals(Iterator('a').intersperse('[', ',', ']').toSeq, Seq('[', 'a', ']')) - Assert.assertEquals(Iterator().intersperse('[', ',', ']').toSeq, Seq('[', ']')) + Assert.assertEquals(Seq(-1, 1, 0, 2, 0, 3, 99), Iterator(1, 2, 3).intersperse(-1, 0, 99).toSeq) + Assert.assertEquals(Seq('[', 'a', ',', 'b', ',', 'c', ']'), + Iterator('a', 'b', 'c').intersperse('[', ',', ']').toSeq) + Assert.assertEquals(Seq('[', 'a', ']'), Iterator('a').intersperse('[', ',', ']').toSeq) + Assert.assertEquals(Seq('[', ']'), Iterator().intersperse('[', ',', ']').toSeq) + } + + @Test + def foldSomeLeftShouldFold(): Unit = { + def sumOp(acc: Int, e: Int): Option[Int] = if (e == 4) None else Some(acc + e) + Assert.assertEquals(0, Iterator().foldSomeLeft(0)(sumOp)) + Assert.assertEquals(6, Iterator(1, 2, 3).foldSomeLeft(0)(sumOp)) + Assert.assertEquals(6, Iterator(1, 2, 3, 4, 5).foldSomeLeft(0)(sumOp)) + Assert.assertEquals(0, Iterator(4, 5).foldSomeLeft(0)(sumOp)) + } + + @Test + def lazyFoldLeftShouldFold(): Unit = { + // Notice how sumOp doesn't evaluate `e` under some conditions. + def sumOp(acc: Int, e: => Int): Int = if (acc >= 5) acc else acc + e + Assert.assertEquals(0, Iterator().lazyFoldLeft(0)(sumOp)) + Assert.assertEquals(3, Iterator(1, 1, 1).lazyFoldLeft(0)(sumOp)) + Assert.assertEquals(6, Iterator(1, 2, 3, 4, 5).lazyFoldLeft(0)(sumOp)) + Assert.assertEquals(5, Iterator(1, 1, 1, 1, 1, 1, 1, 1).lazyFoldLeft(0)(sumOp)) + Assert.assertEquals(9, Iterator(4, 5).lazyFoldLeft(0)(sumOp)) + Assert.assertEquals(9, Iterator(4, 5, 1).lazyFoldLeft(0)(sumOp)) + Assert.assertEquals(10, Iterator(10, 20, 30).lazyFoldLeft(0)(sumOp)) + } + + @Test + def lazyFoldLeftShouldFoldWeirdEdgeCases(): Unit = { + // `delayedSumOp` doesn't return `acc`, causing a delayed stop of the iteration. + def delayedSumOp(acc: Int, e: => Int): Int = if (acc >= 5) 5 else acc + e + Assert.assertEquals(0, Iterator().lazyFoldLeft(0)(delayedSumOp)) + Assert.assertEquals(3, Iterator(1, 1, 1).lazyFoldLeft(0)(delayedSumOp)) + Assert.assertEquals(9, Iterator(4, 5).lazyFoldLeft(0)(delayedSumOp)) + Assert.assertEquals(5, Iterator(4, 5, 1).lazyFoldLeft(0)(delayedSumOp)) + Assert.assertEquals(5, Iterator(6, 1).lazyFoldLeft(0)(delayedSumOp)) + + // `alwaysGrowingSumOp` returns a new value every time, causing no stop in the iteration. + def alwaysGrowingSumOp(acc: Int, e: => Int): Int = if (acc >= 5) acc + 1 else acc + e + Assert.assertEquals(0, Iterator().lazyFoldLeft(0)(alwaysGrowingSumOp)) + Assert.assertEquals(3, Iterator(1, 1, 1).lazyFoldLeft(0)(alwaysGrowingSumOp)) + Assert.assertEquals(9, Iterator(5, 10, 10, 10, 10).lazyFoldLeft(0)(alwaysGrowingSumOp)) + Assert.assertEquals(9, Iterator(4, 5).lazyFoldLeft(0)(alwaysGrowingSumOp)) + Assert.assertEquals(10, Iterator(4, 5, 20).lazyFoldLeft(0)(alwaysGrowingSumOp)) + } + + @Test + def lazyFoldRightShouldFold(): Unit = { + def sumOp(acc: Int): Either[Int, Int => Int] = if (acc >= 5) Left(acc) else Right(acc + _) + Assert.assertEquals(0, Iterator().lazyFoldRight(0)(sumOp)) + Assert.assertEquals(3, Iterator(1, 1, 1).lazyFoldRight(0)(sumOp)) + Assert.assertEquals(15, Iterator(1, 2, 3, 4, 5).lazyFoldRight(0)(sumOp)) + Assert.assertEquals(8, Iterator(1, 1, 1, 1, 1, 1, 1, 1).lazyFoldRight(0)(sumOp)) + Assert.assertEquals(5, Iterator(5, 4).lazyFoldRight(0)(sumOp)) + Assert.assertEquals(6, Iterator(1, 5, 4).lazyFoldRight(0)(sumOp)) + Assert.assertEquals(32, Iterator(32, 21, 10).lazyFoldRight(0)(sumOp)) } @Test def splitByShouldHonorEmptyIterator(): Unit = { val groupedIterator = Iterator.empty.splitBy(identity) Assert.assertFalse(groupedIterator.hasNext) - Assert.assertEquals(Try(groupedIterator.next).toString, Try(Iterator.empty.next()).toString) + Assert.assertEquals(Try(Iterator.empty.next()).toString, Try(groupedIterator.next).toString) } @Test @@ -35,9 +88,9 @@ class IteratorDecoratorTest { val value = Vector("1", "1", "1") val groupedIterator = value.iterator.splitBy(identity) Assert.assertTrue(groupedIterator.hasNext) - Assert.assertEquals(groupedIterator.next.toVector, value) + Assert.assertEquals(value, groupedIterator.next.toVector) Assert.assertFalse(groupedIterator.hasNext) - Assert.assertEquals(Try(groupedIterator.next).toString, Try(Iterator.empty.next()).toString) + Assert.assertEquals(Try(Iterator.empty.next()).toString, Try(groupedIterator.next).toString) } @Test @@ -45,14 +98,23 @@ class IteratorDecoratorTest { val value = Vector("1", "2", "2", "3", "3", "3", "2", "2") val groupedIterator = value.iterator.splitBy(identity) Assert.assertTrue(groupedIterator.hasNext) - Assert.assertEquals(groupedIterator.next.toVector, Vector("1")) + Assert.assertEquals(Vector("1"), groupedIterator.next.toVector) Assert.assertTrue(groupedIterator.hasNext) - Assert.assertEquals(groupedIterator.next.toVector, Vector("2", "2")) + Assert.assertEquals(Vector("2", "2"), groupedIterator.next.toVector) Assert.assertTrue(groupedIterator.hasNext) - Assert.assertEquals(groupedIterator.next.toVector, Vector("3", "3", "3")) + Assert.assertEquals(Vector("3", "3", "3"), groupedIterator.next.toVector) Assert.assertTrue(groupedIterator.hasNext) - Assert.assertEquals(groupedIterator.next.toVector, Vector("2", "2")) + Assert.assertEquals(Vector("2", "2"), groupedIterator.next.toVector) Assert.assertFalse(groupedIterator.hasNext) - Assert.assertEquals(Try(groupedIterator.next).toString, Try(Iterator.empty.next()).toString) + Assert.assertEquals(Try(Iterator.empty.next()).toString, Try(groupedIterator.next).toString) + } + + @Test + def splitByShouldSplitByFunction(): Unit = { + Assert.assertEquals(Seq(Seq((1,1), (1,2)), Seq((2,3))), Iterator((1,1), (1,2), (2,3)).splitBy(_._1).toSeq) + Assert.assertEquals( + Seq(Seq((1,1), (1,2)), Seq((2,3)), Seq((1,4))), + Iterator((1,1), (1,2), (2,3), (1,4)).splitBy(_._1).toSeq + ) } } From c387c32ff9922ff47c48d4026962ab721d4e25a0 Mon Sep 17 00:00:00 2001 From: Erik van Oosten Date: Thu, 24 Oct 2019 21:20:44 +0200 Subject: [PATCH 3/6] Fixed scala-docs. --- .../decorators/IteratorDecorator.scala | 17 +++++++++++++++-- 1 file changed, 15 insertions(+), 2 deletions(-) diff --git a/src/main/scala/scala/collection/decorators/IteratorDecorator.scala b/src/main/scala/scala/collection/decorators/IteratorDecorator.scala index 4677462..6519608 100644 --- a/src/main/scala/scala/collection/decorators/IteratorDecorator.scala +++ b/src/main/scala/scala/collection/decorators/IteratorDecorator.scala @@ -3,6 +3,19 @@ package decorators import scala.annotation.tailrec +/** Enriches [[Iterator]] with additional methods. + * + * @define mayNotTerminateInf + * Note: may not terminate for infinite iterators. + * @define consumesIterator + * After calling this method, one should discard the iterator it was called + * on. Using it is undefined and subject to change. + * @define consumesAndProducesIterator + * After calling this method, one should discard the iterator it was called + * on, and use only the iterator that was returned. Using the old iterator + * is undefined, subject to change, and may result in changes to the new + * iterator as well. + */ class IteratorDecorator[A](val `this`: Iterator[A]) extends AnyVal { /** @@ -17,7 +30,7 @@ class IteratorDecorator[A](val `this`: Iterator[A]) extends AnyVal { * * @param sep the separator value. * @return The resulting iterator contains all elements from the source iterator, separated by the `sep` value. - * @note Reuse: $consumesIterator + * @note Reuse: $consumesAndProducesIterator */ def intersperse[B >: A](sep: B): Iterator[B] = new Iterator[B] { var intersperseNext = false @@ -47,7 +60,7 @@ class IteratorDecorator[A](val `this`: Iterator[A]) extends AnyVal { * begins with the `start` value and ends with the `end` value. * Inside, are all elements from the source iterator separated by * the `sep` value. - * @note Reuse: $consumesIterator + * @note Reuse: $consumesAndProducesIterator */ def intersperse[B >: A](start: B, sep: B, end: B): Iterator[B] = new Iterator[B] { var started = false From 14daa38a0119ae174a369d204412cd8da50c3668 Mon Sep 17 00:00:00 2001 From: Erik van Oosten Date: Thu, 24 Oct 2019 21:32:26 +0200 Subject: [PATCH 4/6] Be more clear about what `===` means. --- .../scala/collection/decorators/IteratorDecorator.scala | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/main/scala/scala/collection/decorators/IteratorDecorator.scala b/src/main/scala/scala/collection/decorators/IteratorDecorator.scala index 6519608..3ef1c7f 100644 --- a/src/main/scala/scala/collection/decorators/IteratorDecorator.scala +++ b/src/main/scala/scala/collection/decorators/IteratorDecorator.scala @@ -15,6 +15,9 @@ import scala.annotation.tailrec * on, and use only the iterator that was returned. Using the old iterator * is undefined, subject to change, and may result in changes to the new * iterator as well. + * @define pseudoCodeExample + * The `===` operator in this pseudo code stands for 'is equivalent to'; + * both sides of the `===` give the same result. */ class IteratorDecorator[A](val `this`: Iterator[A]) extends AnyVal { @@ -27,6 +30,7 @@ class IteratorDecorator[A](val `this`: Iterator[A]) extends AnyVal { * Iterator('a').intersperse(',') === Iterator('a') * Iterator().intersperse(',') === Iterator() * }}} + * $pseudoCodeExample * * @param sep the separator value. * @return The resulting iterator contains all elements from the source iterator, separated by the `sep` value. @@ -52,6 +56,7 @@ class IteratorDecorator[A](val `this`: Iterator[A]) extends AnyVal { * Iterator('a').intersperse('[', ',', ']') === Iterator('[', 'a', ']') * Iterator().intersperse('[', ',', ']') === Iterator('[', ']') * }}} + * $pseudoCodeExample * * @param start the starting value. * @param sep the separator value. @@ -99,6 +104,7 @@ class IteratorDecorator[A](val `this`: Iterator[A]) extends AnyVal { * Iterator(1, 2, 3).foldSomeLeft(0)(sumOp) === 6 * Iterator(1, 2, 3, 4, 5).foldSomeLeft(0)(sumOp) === 6 * }}} + * $pseudoCodeExample * * @param z the start value * @param op the binary operator @@ -169,6 +175,7 @@ class IteratorDecorator[A](val `this`: Iterator[A]) extends AnyVal { * Iterator(1,2,2,3,3,3,2,2).splitBy(identity) === Iterator(Seq(1), Seq(2,2), Seq(3,3,3), Seq(2,2)) * Iterator((1,1), (1,2), (2, 3)).splitBy(_._1) === Iterator(Seq((1,1), (1,2)), Seq((2,3))) * }}} + * $pseudoCodeExample * * @param f the function to compute a key for an element * @tparam K the type of the computed key From 61ed389f70d01f7f974c687cab16cbcbcabb29e2 Mon Sep 17 00:00:00 2001 From: Erik van Oosten Date: Thu, 24 Oct 2019 21:36:19 +0200 Subject: [PATCH 5/6] Fixed doc-link to Iterator. --- .../scala/scala/collection/decorators/IteratorDecorator.scala | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/main/scala/scala/collection/decorators/IteratorDecorator.scala b/src/main/scala/scala/collection/decorators/IteratorDecorator.scala index 3ef1c7f..3a53b88 100644 --- a/src/main/scala/scala/collection/decorators/IteratorDecorator.scala +++ b/src/main/scala/scala/collection/decorators/IteratorDecorator.scala @@ -3,7 +3,7 @@ package decorators import scala.annotation.tailrec -/** Enriches [[Iterator]] with additional methods. +/** Enriches [[scala.collection.Iterator]] with additional methods. * * @define mayNotTerminateInf * Note: may not terminate for infinite iterators. From 69ba1af1697bbc3d93e1c73cec0b8b08dfe6de04 Mon Sep 17 00:00:00 2001 From: Erik van Oosten Date: Thu, 24 Oct 2019 21:37:58 +0200 Subject: [PATCH 6/6] Removed link. --- .../scala/scala/collection/decorators/IteratorDecorator.scala | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/main/scala/scala/collection/decorators/IteratorDecorator.scala b/src/main/scala/scala/collection/decorators/IteratorDecorator.scala index 3a53b88..632e6de 100644 --- a/src/main/scala/scala/collection/decorators/IteratorDecorator.scala +++ b/src/main/scala/scala/collection/decorators/IteratorDecorator.scala @@ -3,7 +3,7 @@ package decorators import scala.annotation.tailrec -/** Enriches [[scala.collection.Iterator]] with additional methods. +/** Enriches Iterator with additional methods. * * @define mayNotTerminateInf * Note: may not terminate for infinite iterators.