IsIterableOnce

scala.collection.generic.IsIterableOnce
See theIsIterableOnce companion object
trait IsIterableOnce[Repr]

Type class witnessing that a collection representation type Repr has elements of type A and has a conversion to IterableOnce[A].

This type enables simple enrichment of IterableOnces with extension methods which can make full use of the mechanics of the Scala collections framework in their implementation.

Example usage,

class FilterMapImpl[Repr, I  Option[B])(implicit bf: BuildFrom[Repr, B, That]): That = {
    val b = bf.newBuilder(coll)
    for(e  if(i % 2 == 0) Some(i) else None)
// == List(2, 4)

Attributes

Companion
object
Source
IsIterableOnce.scala
Graph
Supertypes
class Object
trait Matchable
class Any
Known subtypes
trait IsIterable[Repr]
trait IsMap[Repr]
trait IsSeq[Repr]

Members list

Type members

Types

type A

The type of elements we can traverse over (e.g.

The type of elements we can traverse over (e.g. Int).

Attributes

Source
IsIterableOnce.scala

Value members

Abstract methods

def apply(coll: Repr): IterableOnce[A]

A conversion from the representation type Repr to a IterableOnce[A].

A conversion from the representation type Repr to a IterableOnce[A].

Attributes

Source
IsIterableOnce.scala

Deprecated fields

val conversion: Repr => IterableOnce[A]

Attributes

Deprecated
[Since version 2.13.0] \'conversion\' is now a method named \'apply\'
Source
IsIterableOnce.scala