List[A].lift: (Int) => Option[A]0.6004295

Turns this partial function into a plain function returning an Option result.

returns

a function that takes an argument x to Some(this(x)) if this is defined for x, and to None otherwise.

see

Function.unlift

scala-library scala.collection.immutable.List.lift
Doc ·
LinearSeq[A].lift: (Int) => Option[A]0.5920944

Turns this partial function into a plain function returning an Option result.

returns

a function that takes an argument x to Some(this(x)) if this is defined for x, and to None otherwise.

see

Function.unlift

scala-library scala.collection.immutable.LinearSeq.lift
Doc ·
LinearSeq[A].lift: (Int) => Option[A]0.5893959

Turns this partial function into a plain function returning an Option result.

returns

a function that takes an argument x to Some(this(x)) if this is defined for x, and to None otherwise.

see

Function.unlift

scala-library scala.collection.LinearSeq.lift
Doc ·
Seq[A].lift: (Int) => Option[A]0.5856794

Turns this partial function into a plain function returning an Option result.

returns

a function that takes an argument x to Some(this(x)) if this is defined for x, and to None otherwise.

see

Function.unlift

scala-library scala.collection.immutable.Seq.lift
Doc ·
AbstractSeq[A].lift: (Int) => Option[A]0.57923704

Turns this partial function into a plain function returning an Option result.

returns

a function that takes an argument x to Some(this(x)) if this is defined for x, and to None otherwise.

see

Function.unlift

scala-library scala.collection.AbstractSeq.lift
Doc ·
Seq[A].lift: (Int) => Option[A]0.5592747

Turns this partial function into a plain function returning an Option result.

returns

a function that takes an argument x to Some(this(x)) if this is defined for x, and to None otherwise.

see

Function.unlift

scala-library scala.collection.Seq.lift
Doc ·
ofRef[A].lift: (Int) => Option[A]0.4209922
scalaz-core_2.11 scalaz.ImmutableArray.WrappedImmutableArray.ofRef.lift
Doc ·
Range.lift: (Int) => Option[Int]0.41529927

Turns this partial function into a plain function returning an Option result.

returns

a function that takes an argument x to Some(this(x)) if this is defined for x, and to None otherwise.

see

Function.unlift

scala-library scala.collection.immutable.Range.lift
Doc ·
Inclusive.lift: (Int) => Option[Int]0.41529927

Turns this partial function into a plain function returning an Option result.

returns

a function that takes an argument x to Some(this(x)) if this is defined for x, and to None otherwise.

see

Function.unlift

scala-library scala.collection.immutable.Range.Inclusive.lift
Doc ·
ofInt.lift: (Int) => Option[Int]0.41529927

Turns this partial function into a plain function returning an Option result.

returns

a function that takes an argument x to Some(this(x)) if this is defined for x, and to None otherwise.

see

Function.unlift

scala-library scala.collection.mutable.WrappedArray.ofInt.lift
Doc ·
ofInt.lift: (Int) => Option[Int]0.41529927
scalaz-core_2.11 scalaz.ImmutableArray.WrappedImmutableArray.ofInt.lift
Doc ·
ofShort.lift: (Int) => Option[Short]0.41414917

Turns this partial function into a plain function returning an Option result.

returns

a function that takes an argument x to Some(this(x)) if this is defined for x, and to None otherwise.

see

Function.unlift

scala-library scala.collection.mutable.WrappedArray.ofShort.lift
Doc ·
ofShort.lift: (Int) => Option[Short]0.41414917
scalaz-core_2.11 scalaz.ImmutableArray.WrappedImmutableArray.ofShort.lift
Doc ·
WrappedString.lift: (Int) => Option[Char]0.4141411

Turns this partial function into a plain function returning an Option result.

returns

a function that takes an argument x to Some(this(x)) if this is defined for x, and to None otherwise.

see

Function.unlift

scala-library scala.collection.immutable.WrappedString.lift
Doc ·
StringBuilder.lift: (Int) => Option[Char]0.4141411

Turns this partial function into a plain function returning an Option result.

returns

a function that takes an argument x to Some(this(x)) if this is defined for x, and to None otherwise.

see

Function.unlift

scala-library scala.collection.mutable.StringBuilder.lift
Doc ·
ofChar.lift: (Int) => Option[Char]0.4141411

Turns this partial function into a plain function returning an Option result.

returns

a function that takes an argument x to Some(this(x)) if this is defined for x, and to None otherwise.

see

Function.unlift

scala-library scala.collection.mutable.WrappedArray.ofChar.lift
Doc ·
ofStringArray.lift: (Int) => Option[Char]0.4141411
scalaz-core_2.11 scalaz.ImmutableArray.WrappedImmutableArray.ofStringArray.lift
Doc ·
ofChar.lift: (Int) => Option[Char]0.4141411
scalaz-core_2.11 scalaz.ImmutableArray.WrappedImmutableArray.ofChar.lift
Doc ·
ofByte.lift: (Int) => Option[Byte]0.4140417

Turns this partial function into a plain function returning an Option result.

returns

a function that takes an argument x to Some(this(x)) if this is defined for x, and to None otherwise.

see

Function.unlift

scala-library scala.collection.mutable.WrappedArray.ofByte.lift
Doc ·
ofByte.lift: (Int) => Option[Byte]0.4140417
scalaz-core_2.11 scalaz.ImmutableArray.WrappedImmutableArray.ofByte.lift
Doc ·
List[A].apply(Int): A0.4512721

Selects an element by its index in the list. Note: the execution of apply may take time proportional to the index value.

returns

the element of this list at index idx, where 0 indicates the first element.

throws
IndexOutOfBoundsException

IndexOutOfBoundsException if idx does not satisfy 0 <= idx < length.

scala-library scala.collection.immutable.List.apply
Doc ·
LinearSeq[A].apply(Int): A0.44293705

Selects an element by its index in the immutable sequence.

Example:

scala> val x = List(1, 2, 3, 4, 5)
x: List[Int] = List(1, 2, 3, 4, 5)

scala> x(3)
res1: Int = 4
params
idx

The index to select.

returns

the element of this immutable sequence at index idx, where 0 indicates the first element.

throws
IndexOutOfBoundsException

IndexOutOfBoundsException if idx does not satisfy 0 <= idx < length.

scala-library scala.collection.immutable.LinearSeq.apply
Doc ·
LinearSeq[A].apply(Int): A0.4402385

Selects an element by its index in the sequence.

Example:

scala> val x = List(1, 2, 3, 4, 5)
x: List[Int] = List(1, 2, 3, 4, 5)

scala> x(3)
res1: Int = 4
params
idx

The index to select.

returns

the element of this sequence at index idx, where 0 indicates the first element.

throws
IndexOutOfBoundsException

IndexOutOfBoundsException if idx does not satisfy 0 <= idx < length.

scala-library scala.collection.LinearSeq.apply
Doc ·
Seq[A].apply(Int): A0.43652204

Selects an element by its index in the immutable sequence.

Example:

scala> val x = List(1, 2, 3, 4, 5)
x: List[Int] = List(1, 2, 3, 4, 5)

scala> x(3)
res1: Int = 4
params
idx

The index to select.

returns

the element of this immutable sequence at index idx, where 0 indicates the first element.

throws
IndexOutOfBoundsException

IndexOutOfBoundsException if idx does not satisfy 0 <= idx < length.

scala-library scala.collection.immutable.Seq.apply
Doc ·
AbstractSeq[A].apply(Int): A0.43007967

Selects an element by its index in the sequence.

Example:

scala> val x = List(1, 2, 3, 4, 5)
x: List[Int] = List(1, 2, 3, 4, 5)

scala> x(3)
res1: Int = 4
params
idx

The index to select.

returns

the element of this sequence at index idx, where 0 indicates the first element.

throws
IndexOutOfBoundsException

IndexOutOfBoundsException if idx does not satisfy 0 <= idx < length.

scala-library scala.collection.AbstractSeq.apply
Doc ·
Seq[A].apply(Int): A0.4101173

Selects an element by its index in the sequence.

Example:

scala> val x = List(1, 2, 3, 4, 5)
x: List[Int] = List(1, 2, 3, 4, 5)

scala> x(3)
res1: Int = 4
params
idx

The index to select.

returns

the element of this sequence at index idx, where 0 indicates the first element.

throws
IndexOutOfBoundsException

IndexOutOfBoundsException if idx does not satisfy 0 <= idx < length.

scala-library scala.collection.Seq.apply
Doc ·
GenSeq[A].apply(Int): A0.40683025

Selects an element by its index in the collection.

Example:

scala> val x = List(1, 2, 3, 4, 5)
x: List[Int] = List(1, 2, 3, 4, 5)

scala> x(3)
res1: Int = 4
params
idx

The index to select.

returns

the element of this collection at index idx, where 0 indicates the first element.

throws
IndexOutOfBoundsException

IndexOutOfBoundsException if idx does not satisfy 0 <= idx < length.

scala-library scala.collection.GenSeq.apply
Doc ·
GenSeqFactory[CC].tabulate[A](Int)((Int) => A): CC[A]0.4458359

Produces a collection containing values of a given function over a range of integer values starting from 0.

params
n

The number of elements in the collection

f

The function computing element values

returns

A collection consisting of elements f(0), ..., f(n -1)

scala-library scala.collection.generic.GenSeqFactory.tabulate
Doc ·
GenTraversableFactory[CC].tabulate[A](Int)((Int) => A): CC[A]0.4458359

Produces a collection containing values of a given function over a range of integer values starting from 0.

params
n

The number of elements in the collection

f

The function computing element values

returns

A collection consisting of elements f(0), ..., f(n -1)

scala-library scala.collection.generic.GenTraversableFactory.tabulate
Doc ·
IndexedSeqFactory[CC].tabulate[A](Int)((Int) => A): CC[A]0.4458359

Produces a collection containing values of a given function over a range of integer values starting from 0.

params
n

The number of elements in the collection

f

The function computing element values

returns

A collection consisting of elements f(0), ..., f(n -1)

scala-library scala.collection.generic.IndexedSeqFactory.tabulate
Doc ·
ParFactory[CC].tabulate[A](Int)((Int) => A): CC[A]0.4458359

Produces a parallel collection containing values of a given function over a range of integer values starting from 0.

params
n

The number of elements in the parallel collection

f

The function computing element values

returns

A parallel collection consisting of elements f(0), ..., f(n -1)

scala-library scala.collection.generic.ParFactory.tabulate
Doc ·
SeqFactory[CC].tabulate[A](Int)((Int) => A): CC[A]0.4458359

Produces a collection containing values of a given function over a range of integer values starting from 0.

params
n

The number of elements in the collection

f

The function computing element values

returns

A collection consisting of elements f(0), ..., f(n -1)

scala-library scala.collection.generic.SeqFactory.tabulate
Doc ·
TraversableFactory[CC].tabulate[A](Int)((Int) => A): CC[A]0.4458359

Produces a collection containing values of a given function over a range of integer values starting from 0.

params
n

The number of elements in the collection

f

The function computing element values

returns

A collection consisting of elements f(0), ..., f(n -1)

scala-library scala.collection.generic.TraversableFactory.tabulate
Doc ·
Foldable[F].index[A](F[A], Int): Option[A]0.4347422
returns

the element at index i in a Some, or None if the given index falls outside of the range

scalaz-core_2.11 scalaz.Foldable.index
Doc ·
FromFoldMap[F].index[A](F[A], Int): Option[A]0.4347422
returns

the element at index i in a Some, or None if the given index falls outside of the range

scalaz-core_2.11 scalaz.Foldable.FromFoldMap.index
Doc ·
FromFoldr[F].index[A](F[A], Int): Option[A]0.4347422
returns

the element at index i in a Some, or None if the given index falls outside of the range

scalaz-core_2.11 scalaz.Foldable.FromFoldr.index
Doc ·
Foldable1[F].index[A](F[A], Int): Option[A]0.4347422
returns

the element at index i in a Some, or None if the given index falls outside of the range

scalaz-core_2.11 scalaz.Foldable1.index
Doc ·
Index[F].index[A](F[A], Int): Option[A]0.4347422
returns

the element at index i in a Some, or None if the given index falls outside of the range

scalaz-core_2.11 scalaz.Index.index
Doc ·
Traverse[F].index[A](F[A], Int): Option[A]0.4347422
returns

the element at index i in a Some, or None if the given index falls outside of the range

scalaz-core_2.11 scalaz.Traverse.index
Doc ·
Traverse1[F].index[A](F[A], Int): Option[A]0.4347422
returns

the element at index i in a Some, or None if the given index falls outside of the range

scalaz-core_2.11 scalaz.Traverse1.index
Doc ·
IsomorphismIndex[F, G].index[A](F[A], Int): Option[A]0.4187721
returns

the element at index i in a Some, or None if the given index falls outside of the range

scalaz-core_2.11 scalaz.IsomorphismIndex.index
Doc ·
IsomorphismFoldable[F, G].index[A](F[A], Int): Option[A]0.4187721
returns

the element at index i in a Some, or None if the given index falls outside of the range

scalaz-core_2.11 scalaz.IsomorphismFoldable.index
Doc ·
IsomorphismTraverse[F, G].index[A](F[A], Int): Option[A]0.4187721
returns

the element at index i in a Some, or None if the given index falls outside of the range

scalaz-core_2.11 scalaz.IsomorphismTraverse.index
Doc ·
IsomorphismFoldable1[F, G].index[A](F[A], Int): Option[A]0.4187721
returns

the element at index i in a Some, or None if the given index falls outside of the range

scalaz-core_2.11 scalaz.IsomorphismFoldable1.index
Doc ·
IsomorphismTraverse1[F, G].index[A](F[A], Int): Option[A]0.4187721
returns

the element at index i in a Some, or None if the given index falls outside of the range

scalaz-core_2.11 scalaz.IsomorphismTraverse1.index
Doc ·
List[A].take(Int): List[A]0.43183935

Selects first n elements.

params
n

the number of elements to take from this list.

returns

a list consisting only of the first n elements of this list, or else the whole list, if it has less than n elements.

scala-library scala.collection.immutable.List.take
Doc ·
LinearSeq[A].take(Int): LinearSeq[A]0.42386323

Selects first n elements.

params
n

the number of elements to take from this immutable sequence.

returns

a immutable sequence consisting only of the first n elements of this immutable sequence, or else the whole immutable sequence, if it has less than n elements.

scala-library scala.collection.immutable.LinearSeq.take
Doc ·
LinearSeq[A].take(Int): LinearSeq[A]0.4212809

Selects first n elements.

params
n

the number of elements to take from this sequence.

returns

a sequence consisting only of the first n elements of this sequence, or else the whole sequence, if it has less than n elements.

scala-library scala.collection.LinearSeq.take
Doc ·
Seq[A].take(Int): Seq[A]0.41772446

Selects first n elements.

params
n

the number of elements to take from this immutable sequence.

returns

a immutable sequence consisting only of the first n elements of this immutable sequence, or else the whole immutable sequence, if it has less than n elements.

scala-library scala.collection.immutable.Seq.take
Doc ·
AbstractSeq[A].take(Int): Seq[A]0.41155952

Selects first n elements.

params
n

the number of elements to take from this sequence.

returns

a sequence consisting only of the first n elements of this sequence, or else the whole sequence, if it has less than n elements.

scala-library scala.collection.AbstractSeq.take
Doc ·
Iterable[A].take(Int): Iterable[A]0.40833446

Selects first n elements.

Note: might return different results for different runs, unless the underlying collection type is ordered.

params
n

the number of elements to take from this immutable iterable collection.

returns

a immutable iterable collection consisting only of the first n elements of this immutable iterable collection, or else the whole immutable iterable collection, if it has less than n elements.

scala-library scala.collection.immutable.Iterable.take
Doc ·
Traversable[A].take(Int): Traversable[A]0.40820083

Selects first n elements.

Note: might return different results for different runs, unless the underlying collection type is ordered.

params
n

the number of elements to take from this collection.

returns

a collection consisting only of the first n elements of this collection, or else the whole collection, if it has less than n elements.

scala-library scala.collection.immutable.Traversable.take
Doc ·
List[A].drop(Int): List[A]0.43183935

Selects all elements except first n ones.

params
n

the number of elements to drop from this list.

returns

a list consisting of all elements of this list except the first n ones, or else the empty list, if this list has less than n elements.

scala-library scala.collection.immutable.List.drop
Doc ·
LinearSeq[A].drop(Int): LinearSeq[A]0.42386323

Selects all elements except first n ones.

params
n

the number of elements to drop from this immutable sequence.

returns

a immutable sequence consisting of all elements of this immutable sequence except the first n ones, or else the empty immutable sequence, if this immutable sequence has less than n elements.

scala-library scala.collection.immutable.LinearSeq.drop
Doc ·
LinearSeq[A].drop(Int): LinearSeq[A]0.4212809

Selects all elements except first n ones.

params
n

the number of elements to drop from this sequence.

returns

a sequence consisting of all elements of this sequence except the first n ones, or else the empty sequence, if this sequence has less than n elements.

scala-library scala.collection.LinearSeq.drop
Doc ·
Seq[A].drop(Int): Seq[A]0.41772446

Selects all elements except first n ones.

params
n

the number of elements to drop from this immutable sequence.

returns

a immutable sequence consisting of all elements of this immutable sequence except the first n ones, or else the empty immutable sequence, if this immutable sequence has less than n elements.

scala-library scala.collection.immutable.Seq.drop
Doc ·
AbstractSeq[A].drop(Int): Seq[A]0.41155952

Selects all elements except first n ones.

params
n

the number of elements to drop from this sequence.

returns

a sequence consisting of all elements of this sequence except the first n ones, or else the empty sequence, if this sequence has less than n elements.

scala-library scala.collection.AbstractSeq.drop
Doc ·
Iterable[A].drop(Int): Iterable[A]0.40833446

Selects all elements except first n ones.

Note: might return different results for different runs, unless the underlying collection type is ordered.

params
n

the number of elements to drop from this immutable iterable collection.

returns

a immutable iterable collection consisting of all elements of this immutable iterable collection except the first n ones, or else the empty immutable iterable collection, if this immutable iterable collection has less than n elements.

scala-library scala.collection.immutable.Iterable.drop
Doc ·
Traversable[A].drop(Int): Traversable[A]0.40820083

Selects all elements except first n ones.

Note: might return different results for different runs, unless the underlying collection type is ordered.

params
n

the number of elements to drop from this collection.

returns

a collection consisting of all elements of this collection except the first n ones, or else the empty collection, if this collection has less than n elements.

scala-library scala.collection.immutable.Traversable.drop
Doc ·
List[A].dropRight(Int): List[A]0.43183935

Selects all elements except last n ones.

params
n

The number of elements to take

returns

a list consisting of all elements of this list except the last n ones, or else the empty list, if this list has less than n elements.

scala-library scala.collection.immutable.List.dropRight
Doc ·
LinearSeq[A].dropRight(Int): LinearSeq[A]0.42386323

Selects all elements except last n ones.

params
n

The number of elements to take

returns

a immutable sequence consisting of all elements of this immutable sequence except the last n ones, or else the empty immutable sequence, if this immutable sequence has less than n elements.

scala-library scala.collection.immutable.LinearSeq.dropRight
Doc ·
LinearSeq[A].dropRight(Int): LinearSeq[A]0.4212809

Selects all elements except last n ones.

params
n

The number of elements to take

returns

a sequence consisting of all elements of this sequence except the last n ones, or else the empty sequence, if this sequence has less than n elements.

scala-library scala.collection.LinearSeq.dropRight
Doc ·
Seq[A].dropRight(Int): Seq[A]0.41772446

Selects all elements except last n ones.

params
n

The number of elements to take

returns

a immutable sequence consisting of all elements of this immutable sequence except the last n ones, or else the empty immutable sequence, if this immutable sequence has less than n elements.

scala-library scala.collection.immutable.Seq.dropRight
Doc ·
AbstractSeq[A].dropRight(Int): Seq[A]0.41155952

Selects all elements except last n ones.

params
n

The number of elements to take

returns

a sequence consisting of all elements of this sequence except the last n ones, or else the empty sequence, if this sequence has less than n elements.

scala-library scala.collection.AbstractSeq.dropRight
Doc ·
Iterable[A].dropRight(Int): Iterable[A]0.40833446

Selects all elements except last n ones.

Note: might return different results for different runs, unless the underlying collection type is ordered.

params
n

The number of elements to take

returns

a immutable iterable collection consisting of all elements of this immutable iterable collection except the last n ones, or else the empty immutable iterable collection, if this immutable iterable collection has less than n elements.

scala-library scala.collection.immutable.Iterable.dropRight
Doc ·
List[A].takeRight(Int): List[A]0.43183935

Selects last n elements.

params
n

the number of elements to take

returns

a list consisting only of the last n elements of this list, or else the whole list, if it has less than n elements.

scala-library scala.collection.immutable.List.takeRight
Doc ·
LinearSeq[A].takeRight(Int): LinearSeq[A]0.42386323

Selects last n elements.

params
n

the number of elements to take

returns

a immutable sequence consisting only of the last n elements of this immutable sequence, or else the whole immutable sequence, if it has less than n elements.

scala-library scala.collection.immutable.LinearSeq.takeRight
Doc ·
LinearSeq[A].takeRight(Int): LinearSeq[A]0.4212809

Selects last n elements.

params
n

the number of elements to take

returns

a sequence consisting only of the last n elements of this sequence, or else the whole sequence, if it has less than n elements.

scala-library scala.collection.LinearSeq.takeRight
Doc ·
Seq[A].takeRight(Int): Seq[A]0.41772446

Selects last n elements.

params
n

the number of elements to take

returns

a immutable sequence consisting only of the last n elements of this immutable sequence, or else the whole immutable sequence, if it has less than n elements.

scala-library scala.collection.immutable.Seq.takeRight
Doc ·
AbstractSeq[A].takeRight(Int): Seq[A]0.41155952

Selects last n elements.

params
n

the number of elements to take

returns

a sequence consisting only of the last n elements of this sequence, or else the whole sequence, if it has less than n elements.

scala-library scala.collection.AbstractSeq.takeRight
Doc ·
Iterable[A].takeRight(Int): Iterable[A]0.40833446

Selects last n elements.

Note: might return different results for different runs, unless the underlying collection type is ordered.

params
n

the number of elements to take

returns

a immutable iterable collection consisting only of the last n elements of this immutable iterable collection, or else the whole immutable iterable collection, if it has less than n elements.

scala-library scala.collection.immutable.Iterable.takeRight
Doc ·
ApplicativeOps[F, A].replicateM(Int): F[List[A]]0.42075574
scalaz-core_2.11 scalaz.syntax.ApplicativeOps.replicateM
Doc ·
List[A].slice(Int, Int): List[A]0.4140111
returns

a list containing the elements greater than or equal to index from extending up to (but not including) index until of this list.

example

// Given a list
val letters = List('a','b','c','d','e')
// `slice` returns all elements beginning at index `from` and afterwards,
// up until index `until` (excluding index `until`.)
letters.slice(1,3) // Returns List('b','c')
scala-library scala.collection.immutable.List.slice
Doc ·
LinearSeq[A].slice(Int, Int): LinearSeq[A]0.40636426

Selects an interval of elements. The returned collection is made up of all elements x which satisfy the invariant:

from <= indexOf(x) < until
params
unc_from

the lowest index to include from this immutable sequence.

unc_until

the lowest index to EXCLUDE from this immutable sequence.

returns

a immutable sequence containing the elements greater than or equal to index from extending up to (but not including) index until of this immutable sequence.

scala-library scala.collection.immutable.LinearSeq.slice
Doc ·
List[A].sliding(Int): Iterator[List[A]]0.4140111

Groups elements in fixed size blocks by passing a "sliding window" over them (as opposed to partitioning them, as is done in grouped.) "Sliding window" step is 1 by default.

params
size

the number of elements per group

returns

An iterator producing lists of size size, except the last and the only element will be truncated if there are fewer elements than size.

see

scala.collection.Iterator, method sliding

scala-library scala.collection.immutable.List.sliding
Doc ·
LinearSeq[A].sliding(Int): Iterator[LinearSeq[A]]0.40636426

Groups elements in fixed size blocks by passing a "sliding window" over them (as opposed to partitioning them, as is done in grouped.) "Sliding window" step is 1 by default.

params
size

the number of elements per group

returns

An iterator producing immutable sequences of size size, except the last and the only element will be truncated if there are fewer elements than size.

see

scala.collection.Iterator, method sliding

scala-library scala.collection.immutable.LinearSeq.sliding
Doc ·
List[A].combinations(Int): Iterator[List[A]]0.4140111

Iterates over combinations. A _combination_ of length n is a subsequence of the original sequence, with the elements taken in order. Thus, "xy" and "yy" are both length-2 combinations of "xyy", but "yx" is not. If there is more than one way to generate the same subsequence, only one will be returned.

For example, "xyyy" has three different ways to generate "xy" depending on whether the first, second, or third "y" is selected. However, since all are identical, only one will be chosen. Which of the three will be taken is an implementation detail that is not defined.

returns

An Iterator which traverses the possible n-element combinations of this list.

example

"abbbc".combinations(2) = Iterator(ab, ac, bb, bc)

scala-library scala.collection.immutable.List.combinations
Doc ·
LinearSeq[A].combinations(Int): Iterator[LinearSeq[A]]0.40636426

Iterates over combinations. A _combination_ of length n is a subsequence of the original sequence, with the elements taken in order. Thus, "xy" and "yy" are both length-2 combinations of "xyy", but "yx" is not. If there is more than one way to generate the same subsequence, only one will be returned.

For example, "xyyy" has three different ways to generate "xy" depending on whether the first, second, or third "y" is selected. However, since all are identical, only one will be chosen. Which of the three will be taken is an implementation detail that is not defined.

returns

An Iterator which traverses the possible n-element combinations of this immutable sequence.

example

"abbbc".combinations(2) = Iterator(ab, ac, bb, bc)

scala-library scala.collection.immutable.LinearSeq.combinations
Doc ·
LinearSeq[A].combinations(Int): Iterator[LinearSeq[A]]0.40388852

Iterates over combinations. A _combination_ of length n is a subsequence of the original sequence, with the elements taken in order. Thus, "xy" and "yy" are both length-2 combinations of "xyy", but "yx" is not. If there is more than one way to generate the same subsequence, only one will be returned.

For example, "xyyy" has three different ways to generate "xy" depending on whether the first, second, or third "y" is selected. However, since all are identical, only one will be chosen. Which of the three will be taken is an implementation detail that is not defined.

returns

An Iterator which traverses the possible n-element combinations of this sequence.

example

"abbbc".combinations(2) = Iterator(ab, ac, bb, bc)

scala-library scala.collection.LinearSeq.combinations
Doc ·
List[A].padTo(Int, A): List[A]0.4140111

A copy of this list with an element value appended until a given target length is reached.

typeParams
That

the class of the returned collection. In the standard library configuration, That is always List[B] because an implicit of type CanBuildFrom[List, B, That] is defined in object List.

B

the element type of the returned list.

params
elem

the padding value

len

the target length

bf

an implicit value of class CanBuildFrom which determines the result class That from the current representation type Repr and the new element type B. This is usually the canBuildFrom value defined in object List.

returns

a new collection of type That consisting of all elements of this list followed by the minimal number of occurrences of elem so that the resulting collection has a length of at least len.

scala-library scala.collection.immutable.List.padTo
Doc ·
LinearSeq[A].padTo(Int, A): Seq[A]0.40636426

A copy of this immutable sequence with an element value appended until a given target length is reached.

typeParams
That

the class of the returned collection. Where possible, That is the same class as the current collection class Repr, but this depends on the element type B being admissible for that class, which means that an implicit instance of type CanBuildFrom[Repr, B, That] is found.

B

the element type of the returned immutable sequence.

params
elem

the padding value

len

the target length

bf

an implicit value of class CanBuildFrom which determines the result class That from the current representation type Repr and the new element type B.

returns

a new collection of type That consisting of all elements of this immutable sequence followed by the minimal number of occurrences of elem so that the resulting collection has a length of at least len.

scala-library scala.collection.immutable.LinearSeq.padTo
Doc ·
LinearSeq[A].padTo(Int, A): Seq[A]0.40388852

A copy of this sequence with an element value appended until a given target length is reached.

typeParams
That

the class of the returned collection. Where possible, That is the same class as the current collection class Repr, but this depends on the element type B being admissible for that class, which means that an implicit instance of type CanBuildFrom[Repr, B, That] is found.

B

the element type of the returned sequence.

params
elem

the padding value

len

the target length

bf

an implicit value of class CanBuildFrom which determines the result class That from the current representation type Repr and the new element type B.

returns

a new collection of type That consisting of all elements of this sequence followed by the minimal number of occurrences of elem so that the resulting collection has a length of at least len.

scala-library scala.collection.LinearSeq.padTo
Doc ·
List[A].grouped(Int): Iterator[List[A]]0.4140111

Partitions elements in fixed size lists.

params
size

the number of elements per group

returns

An iterator producing lists of size size, except the last will be less than size size if the elements don't divide evenly.

see

scala.collection.Iterator, method grouped

scala-library scala.collection.immutable.List.grouped
Doc ·
LinearSeq[A].grouped(Int): Iterator[LinearSeq[A]]0.40636426

Partitions elements in fixed size immutable sequences.

params
size

the number of elements per group

returns

An iterator producing immutable sequences of size size, except the last will be less than size size if the elements don't divide evenly.

see

scala.collection.Iterator, method grouped

scala-library scala.collection.immutable.LinearSeq.grouped
Doc ·
List[A].updated(Int, A): List[A]0.4140111

A copy of this list with one single replaced element.

typeParams
That

the class of the returned collection. In the standard library configuration, That is always List[B] because an implicit of type CanBuildFrom[List, B, That] is defined in object List.

B

the element type of the returned list.

params
elem

the replacing element

bf

an implicit value of class CanBuildFrom which determines the result class That from the current representation type Repr and the new element type B. This is usually the canBuildFrom value defined in object List.

index

the position of the replacement

returns

a new list which is a copy of this list with the element at position index replaced by elem.

throws
IndexOutOfBoundsException

IndexOutOfBoundsException if index does not satisfy 0 <= index < length.

scala-library scala.collection.immutable.List.updated
Doc ·
LinearSeq[A].updated(Int, A): Seq[A]0.40636426

A copy of this immutable sequence with one single replaced element.

typeParams
That

the class of the returned collection. Where possible, That is the same class as the current collection class Repr, but this depends on the element type B being admissible for that class, which means that an implicit instance of type CanBuildFrom[Repr, B, That] is found.

B

the element type of the returned immutable sequence.

params
elem

the replacing element

bf

an implicit value of class CanBuildFrom which determines the result class That from the current representation type Repr and the new element type B.

index

the position of the replacement

returns

a new immutable sequence which is a copy of this immutable sequence with the element at position index replaced by elem.

throws
IndexOutOfBoundsException

IndexOutOfBoundsException if index does not satisfy 0 <= index < length.

scala-library scala.collection.immutable.LinearSeq.updated
Doc ·
LinearSeq[A].updated(Int, A): Seq[A]0.40388852

A copy of this sequence with one single replaced element.

typeParams
That

the class of the returned collection. Where possible, That is the same class as the current collection class Repr, but this depends on the element type B being admissible for that class, which means that an implicit instance of type CanBuildFrom[Repr, B, That] is found.

B

the element type of the returned sequence.

params
elem

the replacing element

bf

an implicit value of class CanBuildFrom which determines the result class That from the current representation type Repr and the new element type B.

index

the position of the replacement

returns

a new sequence which is a copy of this sequence with the element at position index replaced by elem.

throws
IndexOutOfBoundsException

IndexOutOfBoundsException if index does not satisfy 0 <= index < length.

scala-library scala.collection.LinearSeq.updated
Doc ·
scala.math.Numeric.IntIsIntegral.tryCompare(Int, Int): Some[Int]0.41105884

Returns whether a comparison between x and y is defined, and if so the result of compare(x, y).

scala-library scala.math.Numeric.IntIsIntegral.tryCompare
Doc ·
scala.math.Ordering.Int.tryCompare(Int, Int): Some[Int]0.41105884

Returns whether a comparison between x and y is defined, and if so the result of compare(x, y).

scala-library scala.math.Ordering.Int.tryCompare
Doc ·
List[A].padTo[B >: A, That](Int, B)(implicit CanBuildFrom[List[A], B, That]): That0.40728527

A copy of this list with an element value appended until a given target length is reached.

typeParams
That

the class of the returned collection. In the standard library configuration, That is always List[B] because an implicit of type CanBuildFrom[List, B, That] is defined in object List.

B

the element type of the returned list.

params
elem

the padding value

len

the target length

bf

an implicit value of class CanBuildFrom which determines the result class That from the current representation type Repr and the new element type B. This is usually the canBuildFrom value defined in object List.

returns

a new collection of type That consisting of all elements of this list followed by the minimal number of occurrences of elem so that the resulting collection has a length of at least len.

scala-library scala.collection.immutable.List.padTo
Doc ·
List[A].updated[B >: A, That](Int, B)(implicit CanBuildFrom[List[A], B, That]): That0.40728527

A copy of this list with one single replaced element.

typeParams
That

the class of the returned collection. In the standard library configuration, That is always List[B] because an implicit of type CanBuildFrom[List, B, That] is defined in object List.

B

the element type of the returned list.

params
elem

the replacing element

bf

an implicit value of class CanBuildFrom which determines the result class That from the current representation type Repr and the new element type B. This is usually the canBuildFrom value defined in object List.

index

the position of the replacement

returns

a new list which is a copy of this list with the element at position index replaced by elem.

throws
IndexOutOfBoundsException

IndexOutOfBoundsException if index does not satisfy 0 <= index < length.

scala-library scala.collection.immutable.List.updated
Doc ·
List[A].isDefinedAt(Int): Boolean0.40640125

Tests whether this list contains given index.

The implementations of methods apply and isDefinedAt turn a Seq[A] into a PartialFunction[Int, A].

params
idx

the index to test

returns

true if this list contains an element at position idx, false otherwise.

scala-library scala.collection.immutable.List.isDefinedAt
Doc ·
List[A].productElement(Int): Any0.40640125

The nth element of this product, 0-based. In other words, for a product A(x1, ..., xk), returns x(n+1) where 0 < n < k.

params
n

the index of the element to return

returns

the element n elements after the first element

throws
IndexOutOfBoundsException
scala-library scala.collection.immutable.List.productElement
Doc ·
List[A].lengthCompare(Int): Int0.40640125

Compares the length of this list to a test value.

params
len

the test value that gets compared with the length.

returns

A value x where

x <  0       if this.length <  len
x == 0       if this.length == len
x >  0       if this.length >  len

The method as implemented here does not call length directly; its running time is O(length min len) instead of O(length). The method should be overwritten if computing length is cheap.

scala-library scala.collection.immutable.List.lengthCompare
Doc ·
scala.util.hashing.MurmurHash3.listHash(List[Any], Int): Int0.40640125
scala-library scala.util.hashing.MurmurHash3.listHash
Doc ·
ApplicativePlus[F].replicateM[A](Int, F[A]): F[List[A]]0.40635726

Performs the action n times, returning the list of results.

scalaz-core_2.11 scalaz.ApplicativePlus.replicateM
Doc ·
Applicative[F].replicateM[A](Int, F[A]): F[List[A]]0.40635726

Performs the action n times, returning the list of results.

scalaz-core_2.11 scalaz.Applicative.replicateM
Doc ·
Monad[F].replicateM[A](Int, F[A]): F[List[A]]0.40635726

Performs the action n times, returning the list of results.

scalaz-core_2.11 scalaz.Monad.replicateM
Doc ·
MonadPlus[F].replicateM[A](Int, F[A]): F[List[A]]0.40635726

Performs the action n times, returning the list of results.

scalaz-core_2.11 scalaz.MonadPlus.replicateM
Doc ·
Nondeterminism[F].replicateM[A](Int, F[A]): F[List[A]]0.40635726

Performs the action n times, returning the list of results.

scalaz-core_2.11 scalaz.Nondeterminism.replicateM
Doc ·