Break a big list into smaller chunks and map each chunk
Filter out elements that match the predicate, applying the supplied function to each filtered out element, and returning the remaining elements.
Applies f
to each item in the collection until the first Some[U] is found and return it, or None otherwise
Groups the given sequence by a function that transforms the sequence into keys and values.
Groups the given sequence by a function that transforms the sequence into keys and values.
For example. Seq(1 -> "a", 2 -> "a", "1" -> "b").groupByKeyValue(x => x)
will return
Map(1 -> List(a, b), 2 -> List(a))
Groups the given sequence by a function that transforms the sequence into keys and values.
Groups the given sequence by a function that transforms the sequence into keys and values.
For example. Seq(1 -> "a", 2 -> "a", "1" -> "b").groupByKeyValue(x => x)
will return
Map(1 -> List(a, b), 2 -> List(a))
Convenience wrapper for Iterable.sliding(2) that gives you #exactlywhatyouwant: tuples instead of Lists
Like toMap
, but accumulates the values into a Set, rather than
discarding the values of duplicated keys.
Like toMap
, but accumulates the values into a Seq, rather than
discarding the values of duplicated keys.
Returns the top N elements in the Iterable.
Returns the top N elements in the Iterable. They'll come back in no particular order.
Returns the top N elements in the Iterable.
Returns the top N elements in the Iterable. They'll come back sorted :)
Returns the top N elements in the Iterable.
Returns the top N elements in the Iterable. They'll come back in no particular order.
Like zip
, but continues even after the second iterable has been exhausted.
Like zip
, but doesn't stop until *both* iterables are exhausted.
Like zip
, but doesn't stop until *both* iterables are exhausted. The length
of the result will be max(firstList.size, secondList.size).
Like zip
, but continues even after the first iterable has been exhausted.