Skip to content

over

In std/seq.

partition fn over<K, O : Orderable, U>(self, by: T -> K, order: T -> O, into: (T, Window<T>) -> U) : List<U>
partition fn over<K, U>(self, by: T -> K, order: (T, T) -> Ordering, into: (T, Window<T>) -> U) : List<U>
partition fn over<O : Orderable, U>(self, order: T -> O, into: (T, Window<T>) -> U) : List<U>
partition fn over<U>(self, order: (T, T) -> Ordering, into: (T, Window<T>) -> U) : List<U>

Each value of self, at its input position, as what into gives for it and its Window: the values with its key by, ordered by order, a key or a comparison. Values equal under order keep their input order. Without by, every value is in one partition. No value is merged or dropped, and into gives no Window: [30, 10, 20] | over(order = x => x, into = (x, w) => w | row_number) is [3, 1, 2].