Skip to content

Commit 7189b86

Browse files
committed
Update IsIterable scaladoc
use `extension` and `using` instead of `implicit`
1 parent 68396ca commit 7189b86

File tree

1 file changed

+1
-5
lines changed

1 file changed

+1
-5
lines changed

library/src/scala/collection/generic/IsIterable.scala

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -41,10 +41,9 @@ import caps.unsafe.untrackedCaptures
4141
* `String`.
4242
*
4343
* {{{
44-
* import scala.collection.{Iterable, IterableOps}
4544
* import scala.collection.generic.IsIterable
4645
*
47-
* class ExtensionMethods[Repr, I <: IsIterable[Repr]](coll: Repr, it: I) {
46+
* extension [Repr, I <: IsIterable[Repr]](coll: Repr)(using it: I) {
4847
* def mapReduce[B](mapper: it.A => B)(reducer: (B, B) => B): B = {
4948
* val iter = it(coll).iterator
5049
* var res = mapper(iter.next())
@@ -54,9 +53,6 @@ import caps.unsafe.untrackedCaptures
5453
* }
5554
* }
5655
*
57-
* implicit def withExtensions[Repr](coll: Repr)(implicit it: IsIterable[Repr]): ExtensionMethods[Repr, it.type] =
58-
* new ExtensionMethods(coll, it)
59-
*
6056
* // See it in action!
6157
* List(1, 2, 3).mapReduce(_ * 2)(_ + _) // res0: Int = 12
6258
* "Yeah, well, you know, that's just, like, your opinion, man.".mapReduce(x => 1)(_ + _) // res1: Int = 59

0 commit comments

Comments
 (0)