Reducible
trait Reducible[t: Type -> Type]
SourceA trait for types that can be reduced to a summary value.
Reducible
is like a non-empty Foldable
and may only be implemented on non-empty data structures.
Signatures
Trait Definitions
Returns the number of elements in t
that satisfy the predicate f
.
Returns t
as a list without the longest prefix that satisfies the predicate f
.
Returns true
if and only if at least one element in t
satisfies the predicate f
.
Alias for findLeft
.
Optionally returns the first element of t
that satisfies the predicate f
when searching from left to right.
Optionally returns the first element of t
that satisfies the predicate f
when searching from left to right.
Optionally returns the first element of t
that satisfies the predicate f
when searching from right to left.
Alias for reduce
.
Reduce t
using the derived SemiGroup
instance.
Left-associative fold of a structure.
Applies f
to a start value s
and all elements in t
going from left to right.
Right-associative fold of a structure.
Applies f
to a start value s
and all elements in t
going from right to left.
def foldRightWithCont(f: a -> ((Unit -> b \ ef) -> b \ ef), z: b, t: t[a]): b \ ef with Reducible[t]
SourceRight-associative fold of a structure.
Applies f
to a start value s
and all elements in t
going from right to left.
A foldRightWithCont
allows early termination by not calling the continuation.
Returns true
if and only if all elements in t
satisfy the predicate f
.
Applies f
to each element in t
.
Returns t
as a list with a
inserted between every two adjacent elements.
Finds the largest element of t
according to the Order
on a
.
Finds the largest element of t
according to the given comparator cmp
.
Returns true
if and only if the element a
is in t
.
Finds the smallest element of t
according to the Order
on a
.
Finds the smallest element of t
according to the given comparator cmp
.
Reduce t
using the derived SemiGroup
instance.
Left-associative reduction on t
using f
.
Applies f
to each element of t
and combines them using the derived SemiGroup
instance.
Right-associative reduction on t
using f
.
Returns the sum of all elements in t
according to the function f
.
Returns the longest prefix of t
as a list that satisfies the predicate f
.