Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 1 addition & 9 deletions library/src/scala/collection/generic/IsIterable.scala
Original file line number Diff line number Diff line change
Expand Up @@ -41,10 +41,9 @@ import caps.unsafe.untrackedCaptures
* `String`.
*
* {{{
* import scala.collection.{Iterable, IterableOps}
* import scala.collection.generic.IsIterable
*
* class ExtensionMethods[Repr, I <: IsIterable[Repr]](coll: Repr, it: I) {
* extension [Repr, I <: IsIterable[Repr]](coll: Repr)(using it: I) {
* def mapReduce[B](mapper: it.A => B)(reducer: (B, B) => B): B = {
* val iter = it(coll).iterator
* var res = mapper(iter.next())
Expand All @@ -54,9 +53,6 @@ import caps.unsafe.untrackedCaptures
* }
* }
*
* implicit def withExtensions[Repr](coll: Repr)(implicit it: IsIterable[Repr]): ExtensionMethods[Repr, it.type] =
* new ExtensionMethods(coll, it)
*
* // See it in action!
* List(1, 2, 3).mapReduce(_ * 2)(_ + _) // res0: Int = 12
* "Yeah, well, you know, that's just, like, your opinion, man.".mapReduce(x => 1)(_ + _) // res1: Int = 59
Expand Down Expand Up @@ -88,10 +84,6 @@ import caps.unsafe.untrackedCaptures
* (See the `IsIterable` companion object, which contains a precise
* specification of the available implicits.)
*
* ''Note'': Currently, it's not possible to combine the implicit conversion and
* the class with the extension methods into an implicit class due to
* limitations of type inference.
*
* ===Implementing `IsIterable` for New Types===
*
* One must simply provide an implicit value of type `IsIterable`
Expand Down
Loading