trait Foldable[F[_]] extends AnyRef
Inspired from the scalaz (https://github.com/scalaz/scalaz) project
- Alphabetic
- By Inheritance
- Foldable
- AnyRef
- Any
- Hide All
- Show All
- Public
- All
Abstract Value Members
-
abstract
def
foldLeft[A, B](fa: F[A], z: B)(f: (B, A) ⇒ B): B
Left-associative fold of a structure.
-
abstract
def
foldMap[A, B](fa: F[A])(f: (A) ⇒ B)(implicit F: Monoid[B]): B
Map each element of the structure to a Monoid, and combine the results.
-
abstract
def
foldRight[A, B](fa: F[A], z: ⇒ B)(f: (A, ⇒ B) ⇒ B): B
Right-associative fold of a structure.
Concrete Value Members
-
final
def
!=(arg0: Any): Boolean
- Definition Classes
- AnyRef → Any
-
final
def
##(): Int
- Definition Classes
- AnyRef → Any
-
final
def
==(arg0: Any): Boolean
- Definition Classes
- AnyRef → Any
-
def
all[A](fa: F[A])(p: (A) ⇒ Boolean): Boolean
Whether all
As infayield true fromp. -
def
allM[G[_], A](fa: F[A])(p: (A) ⇒ G[Boolean])(implicit G: Monad[G]): G[Boolean]
allwith monadic traversal. -
def
any[A](fa: F[A])(p: (A) ⇒ Boolean): Boolean
Whether any
As infayield true fromp. -
def
anyM[G[_], A](fa: F[A])(p: (A) ⇒ G[Boolean])(implicit G: Monad[G]): G[Boolean]
anywith monadic traversal. -
final
def
asInstanceOf[T0]: T0
- Definition Classes
- Any
-
def
clone(): AnyRef
- Attributes
- protected[java.lang]
- Definition Classes
- AnyRef
- Annotations
- @native() @throws( ... )
-
final
def
count[A](fa: F[A]): Int
Alias for
length. -
def
empty[A](fa: F[A]): Boolean
Deforested alias for
toStream(fa).isEmpty. -
final
def
eq(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef
-
def
equals(arg0: Any): Boolean
- Definition Classes
- AnyRef → Any
-
def
finalize(): Unit
- Attributes
- protected[java.lang]
- Definition Classes
- AnyRef
- Annotations
- @throws( classOf[java.lang.Throwable] )
- def findLeft[A](fa: F[A])(f: (A) ⇒ Boolean): Option[A]
- def findRight[A](fa: F[A])(f: (A) ⇒ Boolean): Option[A]
-
def
fold[M](t: F[M])(implicit arg0: Monoid[M]): M
Combine the elements of a structure using a monoid.
-
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.
-
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
Bhas aMonoid. -
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.
-
final
def
getClass(): Class[_]
- Definition Classes
- AnyRef → Any
- Annotations
- @native()
-
def
hashCode(): Int
- Definition Classes
- AnyRef → Any
- Annotations
- @native()
-
def
index[A](fa: F[A], i: Int): Option[A]
- returns
the element at index
iin aSome, orNoneif the given index falls outside of the range
-
def
indexOr[A](fa: F[A], default: ⇒ A, i: Int): A
- returns
the element at index
i, ordefaultif the given index falls outside of the range
-
def
intercalate[A](fa: F[A], a: A)(implicit A: Monoid[A]): A
Insert an
Abetween every A, yielding the sum. -
final
def
isInstanceOf[T0]: Boolean
- Definition Classes
- Any
-
def
length[A](fa: F[A]): Int
Deforested alias for
toStream(fa).size. -
final
def
ne(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef
-
final
def
notify(): Unit
- Definition Classes
- AnyRef
- Annotations
- @native()
-
final
def
notifyAll(): Unit
- Definition Classes
- AnyRef
- Annotations
- @native()
-
def
sequence_[M[_], A](fa: F[M[A]])(implicit a: Applicative[M]): M[Unit]
Strict sequencing in an applicative functor
Mthat ignores the value infa. - def suml[A](fa: F[A])(implicit A: Monoid[A]): A
- def sumr[A](fa: F[A])(implicit A: Monoid[A]): A
-
final
def
synchronized[T0](arg0: ⇒ T0): T0
- Definition Classes
- AnyRef
- def toList[A](fa: F[A]): List[A]
- def toSet[A](fa: F[A]): Set[A]
- def toStream[A](fa: F[A]): Stream[A]
-
def
toString(): String
- Definition Classes
- AnyRef → Any
- def toVector[A](fa: F[A]): Vector[A]
-
def
traverse_[M[_], A, B](fa: F[A])(f: (A) ⇒ M[B])(implicit a: Applicative[M]): M[Unit]
Strict traversal in an applicative functor
Mthat ignores the result off. -
final
def
wait(): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws( ... )
-
final
def
wait(arg0: Long, arg1: Int): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws( ... )
-
final
def
wait(arg0: Long): Unit
- Definition Classes
- AnyRef
- Annotations
- @native() @throws( ... )