trait IterableMonoTransforms [ +A, +Repr ]
extends Any

Type-preserving transforms over iterables. Operations defined here return in their result iterables of the same type as the one they are invoked on.

Constructors

Members

protected def coll : Iterable [ A ]
def drop ( n: Int ) : Repr

The rest of the collection without its n first elements. For linear, immutable collections this should avoid making a copy.

The rest of the collection without its n first elements. For linear, immutable collections this should avoid making a copy.

def filter ( p: A => Boolean ) : Repr

All elements satisfying predicate p

All elements satisfying predicate p

protected def fromIterableWithSameElemType ( coll: Iterable [ A ] ) : Repr
[+] def partition ( p: A => Boolean ) : ( Repr, Repr )

A pair of, first, all elements that satisfy prediacte p and, second, all elements that do not. Interesting because it splits a collection in two.

The de...

A pair of, first, all elements that satisfy prediacte p and, second, all elements that do not. Interesting because it splits a collection in two.

The default implementation provided here needs to traverse the collection twice. Strict collections have an overridden version of partition in Buildable, which requires only a single traversal.

def tail : Repr

The rest of the collection without its first element.

The rest of the collection without its first element.

def take ( n: Int ) : Repr

A collection containing the first n elements of this collection.

A collection containing the first n elements of this collection.