Return a sublist of items where at most N items for any given predicate value are included.
Return a sublist of items where at most N items for any given predicate value are included. Preserves order within a group, but not the order of predicates (yet!).
Return a Map whose keys are the items in this Iterable, and whose values are the number of times that item occurred in the list
Return a list of lists divided by the provided predicate.
Return a histogram (sequence of (item, count) elements) by a given function.
Return a histogram (sequence of (item, count) elements) by a given function.
Usage: Seq("Do", "Re", "Mi", "Fa", "So", "La", "Ti", "Do").histogramBy(_.last) // returns: Vector((o,3), (a,2), (i,2), (e,1))
Return the smallest element from the Seq according to the supplied sort function.
Create a new collection which separates the elements of the original collection by sep
Partition a list by an arbitrary set of predicates.
Partition a list by an arbitrary set of predicates. The output is a list of lists, where the
index in that list indicates which predicate the element passed. The remainder (those elements
that did not pass any test) is stored at index fs.size.
Example: (0 to 10).partitionN((x: Int) => x % 3 =? 0, (x: Int) => x % 5 =? 0) // returns: Vector(Vector(0, 3, 6, 9), Vector(5, 10), Vector(1, 2, 4, 7, 8))