Foldable1

trait Foldable1[F[_]] extends Foldable[F]

A scalaz.Foldable where foldMap is total over semigroups. That is, toList cannot return an empty list.

Companion
object
trait Foldable[F]
class Object
trait Matchable
class Any

Type members

Classlikes

Inherited classlikes

Inherited from
Foldable

Value members

Abstract methods

def foldMap1[A, B](fa: F[A])(f: A => B)(implicit F: Semigroup[B]): B

Map each element of the structure to a scalaz.Semigroup, and combine the results.

Map each element of the structure to a scalaz.Semigroup, and combine the results.

def foldMapRight1[A, B](fa: F[A])(z: A => B)(f: (A, => B) => B): B

Right-associative fold of a structure.

Right-associative fold of a structure.

Concrete methods

def compose[G[_] : Foldable1]: Foldable1[[α] =>> F[G[α]]]

The composition of Foldable1 F and G, [x]F[G[x]], is a Foldable1

The composition of Foldable1 F and G, [x]F[G[x]], is a Foldable1

def distinct1[A](fa: F[A])(implicit A: Order[A]): NonEmptyList[A]

O(n log n) complexity

O(n log n) complexity

def distinctE1[A](fa: F[A])(implicit A: Equal[A]): NonEmptyList[A]

O(n^2^) complexity

O(n^2^) complexity

final override
def empty[A](fa: F[A]): Boolean

always return false

always return false

Definition Classes
def fold1[M : Semigroup](t: F[M]): M
def foldLeft1[A](fa: F[A])(f: (A, A) => A): A

Left-associative fold of a structure.

Left-associative fold of a structure.

def foldLeftM1[G[_], A, B](fa: F[A])(z: A => B)(f: (B, A) => G[B])(implicit G: Monad[G]): G[B]
override
def foldMap[A, B](fa: F[A])(f: A => B)(implicit F: Monoid[B]): B
Definition Classes
override
def foldMap1Opt[A, B](fa: F[A])(f: A => B)(implicit F: Semigroup[B]): Option[B]
Definition Classes
def foldMapLeft1[A, B](fa: F[A])(z: A => B)(f: (B, A) => B): B

Left-associative fold of a structure.

Left-associative fold of a structure.

override
def foldMapLeft1Opt[A, B](fa: F[A])(z: A => B)(f: (B, A) => B): Option[B]
Definition Classes
override
def foldMapRight1Opt[A, B](fa: F[A])(z: A => B)(f: (A, => B) => B): Option[B]
Definition Classes
override
def foldRight[A, B](fa: F[A], z: => B)(f: (A, => B) => B): B
Definition Classes
def foldRight1[A](fa: F[A])(f: (A, => A) => A): A

Right-associative fold of a structure.

Right-associative fold of a structure.

def foldRightM1[G[_], A, B](fa: F[A])(z: A => B)(f: (A, => B) => G[B])(implicit G: Monad[G]): G[B]
final
def foldl1[A](fa: F[A])(f: A => A => A): A

Curried foldLeft1.

Curried foldLeft1.

override
def foldl1Opt[A](fa: F[A])(f: A => A => A): Option[A]
Definition Classes
final
def foldlM1[G[_] : Monad, A, B](fa: F[A])(z: A => B)(f: B => A => G[B]): G[B]

Curried version of foldLeftM1

Curried version of foldLeftM1

final
def foldr1[A](fa: F[A])(f: A => (=> A) => A): A

Curried foldRight1.

Curried foldRight1.

override
def foldr1Opt[A](fa: F[A])(f: A => (=> A) => A): Option[A]
Definition Classes
final
def foldrM1[G[_] : Monad, A, B](fa: F[A])(z: A => B)(f: A => (=> B) => G[B]): G[B]

Curried version of foldRightM1

Curried version of foldRightM1

override
def intercalate[A : Monoid](fa: F[A], a: A): A
Definition Classes
def intercalate1[A](fa: F[A], a: A)(implicit A: Semigroup[A]): A

Insert an A between every A, yielding the sum.

Insert an A between every A, yielding the sum.

override
def maximum[A : Order](fa: F[A]): Option[A]
Definition Classes
def maximum1[A : Order](fa: F[A]): A

The greatest element of fa.

The greatest element of fa.

override
def maximumBy[A, B : Order](fa: F[A])(f: A => B): Option[A]
Definition Classes
def maximumBy1[A, B : Order](fa: F[A])(f: A => B): A

The element a of fa which yield the greatest value of f(a).

The element a of fa which yield the greatest value of f(a).

override
def maximumOf[A, B : Order](fa: F[A])(f: A => B): Option[B]
Definition Classes
def maximumOf1[A, B : Order](fa: F[A])(f: A => B): B

The greatest value of f(a) for each element a of fa.

The greatest value of f(a) for each element a of fa.

override
def minimum[A : Order](fa: F[A]): Option[A]
Definition Classes
def minimum1[A : Order](fa: F[A]): A

The smallest element of fa.

The smallest element of fa.

override
def minimumBy[A, B : Order](fa: F[A])(f: A => B): Option[A]
Definition Classes
def minimumBy1[A, B : Order](fa: F[A])(f: A => B): A

The element a of fa which yield the smallest value of f(a).

The element a of fa which yield the smallest value of f(a).

override
def minimumOf[A, B : Order](fa: F[A])(f: A => B): Option[B]
Definition Classes
def minimumOf1[A, B : Order](fa: F[A])(f: A => B): B

The smallest value of f(a) for each element a of fa.

The smallest value of f(a) for each element a of fa.

def msuml1[G[_], A](fa: F[G[A]])(implicit G: Plus[G]): G[A]
def product[G[_]](implicit G0: Foldable1[G]): Foldable1[[α] =>> (F[α], G[α])]

The product of Foldable1 F and G, [x](F[x], G[x]]), is a Foldable1

The product of Foldable1 F and G, [x](F[x], G[x]]), is a Foldable1

def product0[G[_]](implicit G0: Foldable[G]): Foldable1[[α] =>> (F[α], G[α])]

The product of Foldable1 F and Foldable G, [x](F[x], G[x]]), is a Foldable1

The product of Foldable1 F and Foldable G, [x](F[x], G[x]]), is a Foldable1

def psum1[G[_], A](fa: F[G[A]])(implicit G: Plus[G]): G[A]
def psumMap1[A, B, G[_]](fa: F[A])(f: A => G[B])(implicit G: Plus[G]): G[B]
def scanLeft1[A](fa: F[A])(f: (A, A) => A): NonEmptyList[A]
def scanRight1[A](fa: F[A])(f: (A, A) => A): NonEmptyList[A]
def sequence1_[M[_], A](fa: F[M[A]])(implicit a: Apply[M], x: Semigroup[M[A]]): M[Unit]
def suml1[A](fa: F[A])(implicit A: Semigroup[A]): A
def sumr1[A](fa: F[A])(implicit A: Semigroup[A]): A
def toNel[A](fa: F[A]): NonEmptyList[A]
def traverse1_[M[_], A, B](fa: F[A])(f: A => M[B])(implicit a: Apply[M], x: Semigroup[M[B]]): M[Unit]

Inherited methods

def all[A](fa: F[A])(p: A => Boolean): Boolean

Whether all As in fa yield true from p.

Whether all As in fa yield true from p.

Inherited from
Foldable
def allM[G[_], A](fa: F[A])(p: A => G[Boolean])(implicit G: Monad[G]): G[Boolean]

all with monadic traversal.

all with monadic traversal.

Inherited from
Foldable
def any[A](fa: F[A])(p: A => Boolean): Boolean

Whether any As in fa yield true from p.

Whether any As in fa yield true from p.

Inherited from
Foldable
def anyM[G[_], A](fa: F[A])(p: A => G[Boolean])(implicit G: Monad[G]): G[Boolean]

any with monadic traversal.

any with monadic traversal.

Inherited from
Foldable
final
def asum[G[_], A](fa: F[G[A]])(implicit G: PlusEmpty[G]): G[A]

Alias for psum. asum is the name used in Haskell.

Alias for psum. asum is the name used in Haskell.

Inherited from
Foldable
def bicompose[G[_, _] : Bifoldable]: Bifoldable[[α, β] =>> F[G[α, β]]]

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
def collapse[X[_], A](x: F[A])(implicit A: ApplicativePlus[X]): X[A]
Inherited from
Foldable
def compose[G[_]](implicit G0: Foldable[G]): Foldable[[α] =>> F[G[α]]]

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
final
def count[A](fa: F[A]): Int

Alias for length.

Alias for length.

Inherited from
Foldable
def distinct[A](fa: F[A])(implicit A: Order[A]): IList[A]

O(n log n) complexity

O(n log n) complexity

Inherited from
Foldable
def distinctBy[A, B : Equal](fa: F[A])(f: A => B): IList[A]
Inherited from
Foldable
def distinctE[A](fa: F[A])(implicit A: Equal[A]): IList[A]

O(n^2^) complexity

O(n^2^) complexity

Inherited from
Foldable
def element[A : Equal](fa: F[A], a: A): Boolean

Whether a is an element of fa.

Whether a is an element of fa.

Inherited from
Foldable
def extrema[A : Order](fa: F[A]): Option[(A, A)]

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
def extremaBy[A, B : Order](fa: F[A])(f: A => B): Option[(A, A)]

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
def extremaOf[A, B : Order](fa: F[A])(f: A => B): Option[(B, B)]

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
def filterLength[A](fa: F[A])(f: A => Boolean): Int
Inherited from
Foldable
def findLeft[A](fa: F[A])(f: A => Boolean): Option[A]
Inherited from
Foldable
final
def findMapM[M[_] : Monad, A, B](fa: F[A])(f: A => M[Option[B]]): M[Option[B]]

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
def findRight[A](fa: F[A])(f: A => Boolean): Option[A]
Inherited from
Foldable
def fold[M : Monoid](t: F[M]): M

Combine the elements of a structure using a monoid.

Combine the elements of a structure using a monoid.

Inherited from
Foldable
def fold1Opt[A : Semigroup](fa: F[A]): Option[A]

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
def foldLeft[A, B](fa: F[A], z: B)(f: (B, A) => B): B

Left-associative fold of a structure.

Left-associative fold of a structure.

Inherited from
Foldable
def foldLeft1Opt[A](fa: F[A])(f: (A, A) => A): Option[A]
Inherited from
Foldable
def foldLeftM[G[_], A, B](fa: F[A], z: B)(f: (B, A) => G[B])(implicit M: Monad[G]): G[B]

Left-associative, monadic fold of a structure.

Left-associative, monadic fold of a structure.

Inherited from
Foldable
def foldMapM[G[_], A, B](fa: F[A])(f: A => G[B])(implicit B: Monoid[B], G: Monad[G]): G[B]

Specialization of foldRightM when B has a Monoid.

Specialization of foldRightM when B has a Monoid.

Inherited from
Foldable
def foldRight1Opt[A](fa: F[A])(f: (A, => A) => A): Option[A]
Inherited from
Foldable
def foldRightM[G[_], A, B](fa: F[A], z: => B)(f: (A, => B) => G[B])(implicit M: Monad[G]): G[B]

Right-associative, monadic fold of a structure.

Right-associative, monadic fold of a structure.

Inherited from
Foldable
Inherited from
Foldable
final
def foldl[A, B](fa: F[A], z: B)(f: B => A => B): B

Curried version of foldLeft

Curried version of foldLeft

Inherited from
Foldable
final
def foldlM[G[_], A, B](fa: F[A], z: => B)(f: B => A => G[B])(implicit M: Monad[G]): G[B]

Curried version of foldLeftM

Curried version of foldLeftM

Inherited from
Foldable
final
def foldr[A, B](fa: F[A], z: => B)(f: A => (=> B) => B): B

Curried version of foldRight

Curried version of foldRight

Inherited from
Foldable
final
def foldrM[G[_], A, B](fa: F[A], z: => B)(f: A => (=> B) => G[B])(implicit M: Monad[G]): G[B]

Curried version of foldRightM

Curried version of foldRightM

Inherited from
Foldable
def index[A](fa: F[A], i: Int): Option[A]
Returns

the element at index i in a Some, or None if the given index falls outside of the range

Inherited from
Foldable
def indexOr[A](fa: F[A], default: => A, i: Int): A
Returns

the element at index i, or default if the given index falls outside of the range

Inherited from
Foldable
def length[A](fa: F[A]): Int

Deforested alias for toStream(fa).size.

Deforested alias for toStream(fa).size.

Inherited from
Foldable
def longDigits[A](fa: F[A])(implicit d: A <:< Digit): Long
Inherited from
Foldable
def product[G[_]](implicit G0: Foldable[G]): Foldable[[α] =>> (F[α], G[α])]

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
def product0[G[_]](implicit G0: Foldable1[G]): Foldable1[[α] =>> (F[α], G[α])]

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
def psum[G[_], A](fa: F[G[A]])(implicit G: PlusEmpty[G]): G[A]

Sum using a polymorphic monoid (PlusEmpty). Should support early termination, i.e. summing no more elements than is needed to determine the result.

Sum using a polymorphic monoid (PlusEmpty). Should support early termination, i.e. summing no more elements than is needed to determine the result.

Inherited from
Foldable
def psumMap[A, B, G[_]](fa: F[A])(f: A => G[B])(implicit G: PlusEmpty[G]): G[B]

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.

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.

Inherited from
Foldable
def selectSplit[A](fa: F[A])(p: A => Boolean): List[NonEmptyList[A]]

Selects groups of elements that satisfy p and discards others.

Selects groups of elements that satisfy p and discards others.

Inherited from
Foldable
def sequenceF_[M[_], A](ffa: F[Free[M, A]]): Free[M, Unit]

sequence_ for Free. collapses into a single Free *

sequence_ for Free. collapses into a single Free *

Inherited from
Foldable
def sequenceS_[S, A](fga: F[State[S, A]]): State[S, Unit]

sequence_ specialized to State *

sequence_ specialized to State *

Inherited from
Foldable
def sequence_[M[_], A](fa: F[M[A]])(implicit a: Applicative[M]): M[Unit]

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
def splitBy[A, B : Equal](fa: F[A])(f: A => B): IList[(B, NonEmptyList[A])]

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
def splitByRelation[A](fa: F[A])(r: (A, A) => Boolean): IList[NonEmptyList[A]]

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
def splitWith[A](fa: F[A])(p: A => Boolean): List[NonEmptyList[A]]

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
def suml[A](fa: F[A])(implicit A: Monoid[A]): A
Inherited from
Foldable
def suml1Opt[A](fa: F[A])(implicit A: Semigroup[A]): Option[A]
Inherited from
Foldable
def sumr[A](fa: F[A])(implicit A: Monoid[A]): A
Inherited from
Foldable
def sumr1Opt[A](fa: F[A])(implicit A: Semigroup[A]): Option[A]
Inherited from
Foldable
def toEphemeralStream[A](fa: F[A]): EphemeralStream[A]
Inherited from
Foldable
def toIList[A](fa: F[A]): IList[A]
Inherited from
Foldable
def toList[A](fa: F[A]): List[A]
Inherited from
Foldable
def toSet[A](fa: F[A]): Set[A]
Inherited from
Foldable
def toStream[A](fa: F[A]): Stream[A]
Inherited from
Foldable
def toVector[A](fa: F[A]): Vector[A]
Inherited from
Foldable
def traverseS_[S, A, B](fa: F[A])(f: A => State[S, B]): State[S, Unit]

traverse_ specialized to State *

traverse_ specialized to State *

Inherited from
Foldable
final
def traverseU_[A, GB](fa: F[A])(f: A => GB)(implicit G: Unapply[[F[_]] =>> Applicative[F], GB]): M[Unit]

A version of traverse_ that infers the type constructor M.

A version of traverse_ that infers the type constructor M.

Inherited from
Foldable
def traverse_[M[_], A, B](fa: F[A])(f: A => M[B])(implicit a: Applicative[M]): M[Unit]

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

Deprecated and Inherited methods

@deprecated("use psum", "7.3.0")
def msuml[G[_], A](fa: F[G[A]])(implicit G: PlusEmpty[G]): G[A]
Deprecated
Inherited from
Foldable
@deprecated("use psum", "7.3.0")
def msumlU[GA](fa: F[GA])(implicit G: Unapply[[F[_]] =>> PlusEmpty[F], GA]): M[A]
Deprecated
Inherited from
Foldable

Concrete fields

Inherited fields

Inherited from
Foldable