Foldable

object Foldable
Companion
class
class Object
trait Matchable
class Any

Type members

Classlikes

trait FromFoldMap[F[_]] extends Foldable[F]

Template trait to define Foldable in terms of foldMap.

Template trait to define Foldable in terms of foldMap.

Example:

new Foldable[Option] with Foldable.FromFoldMap[Option] {
 def foldMap[A, B](fa: Option[A])(f: A => B)(implicit F: Monoid[B]) = fa match {
   case Some(a) => f(a)
   case None    => F.zero
 }
}
trait FromFoldr[F[_]] extends Foldable[F]

Template trait to define Foldable in terms of foldRight

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
 }
}

Value members

Concrete methods

@inline
def apply[F[_]](implicit F: Foldable[F]): Foldable[F]
def fromIso[F[_], G[_]](D: NaturalTransformation[F, G])(implicit E: Foldable[G]): Foldable[F]

Implicits

Implicits

implicit