FromFoldr
Template trait to define Foldable
in terms of foldRight
Example:
new Foldable[Option] with Foldable.FromFoldr[Option] {
def foldRight[A, B](fa: Option[A], z: B)(f: (A, => B) => B) = fa match {
case Some(a) => f(a, z)
case None => z
}
}
Type members
Inherited classlikes
Value members
Concrete methods
Inherited methods
Whether all A
s in fa
yield true from p
.
Whether all A
s in fa
yield true from p
.
- Inherited from
- Foldable
Whether any A
s in fa
yield true from p
.
Whether any A
s in fa
yield true from p
.
- Inherited from
- Foldable
The composition of Foldable F
and Bifoldable G
, [x, y]F[G[x, y]]
, is a Bifoldable
The composition of Foldable F
and Bifoldable G
, [x, y]F[G[x, y]]
, is a Bifoldable
- Inherited from
- Foldable
The composition of Foldables F
and G
, [x]F[G[x]]
, is a Foldable
The composition of Foldables F
and G
, [x]F[G[x]]
, is a Foldable
- Inherited from
- Foldable
Deforested alias for toStream(fa).isEmpty
.
Deforested alias for toStream(fa).isEmpty
.
- Inherited from
- Foldable
The smallest and largest elements of fa
or None if fa
is empty
The smallest and largest elements of fa
or None if fa
is empty
- Inherited from
- Foldable
The elements (amin, amax) of fa
which yield the smallest and largest values of f(a)
, respectively, or None if fa
is empty
The elements (amin, amax) of fa
which yield the smallest and largest values of f(a)
, respectively, or None if fa
is empty
- Inherited from
- Foldable
The smallest and largest values of f(a)
for each element a
of fa
, or None if fa
is empty
The smallest and largest values of f(a)
for each element a
of fa
, or None if fa
is empty
- Inherited from
- Foldable
map elements in a Foldable with a monadic function and return the first element that is mapped successfully
map elements in a Foldable with a monadic function and return the first element that is mapped successfully
- Inherited from
- Foldable
Combine the elements of a structure using a monoid.
Combine the elements of a structure using a monoid.
- Inherited from
- Foldable
Like fold
but returning None
if the foldable is empty and Some
otherwise
Like fold
but returning None
if the foldable is empty and Some
otherwise
- Inherited from
- Foldable
Left-associative, monadic fold of a structure.
Left-associative, monadic fold of a structure.
- Inherited from
- Foldable
As foldMap
but returning None
if the foldable is empty and Some
otherwise
As foldMap
but returning None
if the foldable is empty and Some
otherwise
- Inherited from
- Foldable
Specialization of foldRightM when B
has a Monoid
.
Specialization of foldRightM when B
has a Monoid
.
- Inherited from
- Foldable
Right-associative fold of a structure.
Right-associative fold of a structure.
- Inherited from
- Foldable
Right-associative, monadic fold of a structure.
Right-associative, monadic fold of a structure.
- Inherited from
- Foldable
- Returns
the element at index
i
in aSome
, orNone
if the given index falls outside of the range- Inherited from
- Foldable
- Returns
the element at index
i
, ordefault
if the given index falls outside of the range- Inherited from
- Foldable
Insert an A
between every A, yielding the sum.
Insert an A
between every A, yielding the sum.
- Inherited from
- Foldable
Deforested alias for toStream(fa).size
.
Deforested alias for toStream(fa).size
.
- Inherited from
- Foldable
The greatest element of fa
, or None if fa
is empty.
The greatest element of fa
, or None if fa
is empty.
- Inherited from
- Foldable
The element a
of fa
which yields the greatest value of f(a)
, or None if fa
is empty.
The element a
of fa
which yields the greatest value of f(a)
, or None if fa
is empty.
- Inherited from
- Foldable
The greatest value of f(a)
for each element a
of fa
, or None if fa
is empty.
The greatest value of f(a)
for each element a
of fa
, or None if fa
is empty.
- Inherited from
- Foldable
The smallest element of fa
, or None if fa
is empty.
The smallest element of fa
, or None if fa
is empty.
- Inherited from
- Foldable
The element a
of fa
which yields the smallest value of f(a)
, or None if fa
is empty.
The element a
of fa
which yields the smallest value of f(a)
, or None if fa
is empty.
- Inherited from
- Foldable
The smallest value of f(a)
for each element a
of fa
, or None if fa
is empty.
The smallest value of f(a)
for each element a
of fa
, or None if fa
is empty.
- Inherited from
- Foldable
The product of Foldables F
and G
, [x](F[x], G[x]])
, is a Foldable
The product of Foldables F
and G
, [x](F[x], G[x]])
, is a Foldable
- Inherited from
- Foldable
The product of Foldable F
and Foldable1 G
, [x](F[x], G[x]])
, is a Foldable1
The product of Foldable F
and Foldable1 G
, [x](F[x], G[x]])
, is a Foldable1
- Inherited from
- Foldable
Sum using a polymorphic monoid (PlusEmpty). Should support early termination, i.e. summing no more elements than is needed to determine the result.
Map elements to G[B]
and sum using a polymorphic monoid (PlusEmpty).
Should support early termination, i.e. mapping and summing
no more elements than is needed to determine the result.
Selects groups of elements that satisfy p and discards others.
Selects groups of elements that satisfy p and discards others.
- Inherited from
- Foldable
sequence_
for Free. collapses into a single Free *
sequence_
for Free. collapses into a single Free *
- Inherited from
- Foldable
Strict sequencing in an applicative functor M
that ignores the value in fa
.
Strict sequencing in an applicative functor M
that ignores the value in fa
.
- Inherited from
- Foldable
Splits the elements into groups that produce the same result by a function f.
Splits the elements into groups that produce the same result by a function f.
- Inherited from
- Foldable
Splits into groups of elements that are transitively dependant by a relation r.
Splits into groups of elements that are transitively dependant by a relation r.
- Inherited from
- Foldable
Splits the elements into groups that alternatively satisfy and don't satisfy the predicate p.
Splits the elements into groups that alternatively satisfy and don't satisfy the predicate p.
- Inherited from
- Foldable
A version of traverse_
that infers the type constructor M
.
A version of traverse_
that infers the type constructor M
.
- Inherited from
- Foldable
Strict traversal in an applicative functor M
that ignores the result of f
.
Strict traversal in an applicative functor M
that ignores the result of f
.
- Inherited from
- Foldable