trait UnorderedFoldable[F[_]] extends Serializable
UnorderedFoldable
is like a Foldable
for unordered containers.
- Source
- UnorderedFoldable.scala
- Alphabetic
- By Inheritance
- UnorderedFoldable
- Serializable
- AnyRef
- Any
- Hide All
- Show All
- Public
- Protected
Abstract Value Members
- abstract def unorderedFoldMap[A, B](fa: F[A])(f: (A) => B)(implicit arg0: CommutativeMonoid[B]): B
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
- final def asInstanceOf[T0]: T0
- Definition Classes
- Any
- def clone(): AnyRef
- Attributes
- protected[lang]
- Definition Classes
- AnyRef
- Annotations
- @throws(classOf[java.lang.CloneNotSupportedException]) @native()
- def contains_[A](fa: F[A], v: A)(implicit ev: Eq[A]): Boolean
Tests if
fa
containsv
using theEq
instance forA
- def count[A](fa: F[A])(p: (A) => Boolean): Long
Count the number of elements in the structure that satisfy the given predicate.
Count the number of elements in the structure that satisfy the given predicate.
For example:
scala> import cats.implicits._ scala> val map1 = Map[Int, String]() scala> val p1: String => Boolean = _.length > 0 scala> UnorderedFoldable[Map[Int, *]].count(map1)(p1) res0: Long = 0 scala> val map2 = Map(1 -> "hello", 2 -> "world", 3 -> "!") scala> val p2: String => Boolean = _.length > 1 scala> UnorderedFoldable[Map[Int, *]].count(map2)(p2) res1: Long = 2
- final def eq(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef
- def equals(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef → Any
- def exists[A](fa: F[A])(p: (A) => Boolean): Boolean
Check whether at least one element satisfies the predicate.
Check whether at least one element satisfies the predicate.
If there are no elements, the result is
false
. - def finalize(): Unit
- Attributes
- protected[lang]
- Definition Classes
- AnyRef
- Annotations
- @throws(classOf[java.lang.Throwable])
- def forall[A](fa: F[A])(p: (A) => Boolean): Boolean
Check whether all elements satisfy the predicate.
Check whether all elements satisfy the predicate.
If there are no elements, the result is
true
. - final def getClass(): Class[_ <: AnyRef]
- Definition Classes
- AnyRef → Any
- Annotations
- @native()
- def hashCode(): Int
- Definition Classes
- AnyRef → Any
- Annotations
- @native()
- def isEmpty[A](fa: F[A]): Boolean
Returns true if there are no elements.
Returns true if there are no elements. Otherwise false.
- final def isInstanceOf[T0]: Boolean
- Definition Classes
- Any
- final def ne(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef
- def nonEmpty[A](fa: F[A]): Boolean
- final def notify(): Unit
- Definition Classes
- AnyRef
- Annotations
- @native()
- final def notifyAll(): Unit
- Definition Classes
- AnyRef
- Annotations
- @native()
- def size[A](fa: F[A]): Long
The size of this UnorderedFoldable.
The size of this UnorderedFoldable.
This is overridden in structures that have more efficient size implementations (e.g. Vector, Set, Map).
Note: will not terminate for infinite-sized collections.
- final def synchronized[T0](arg0: => T0): T0
- Definition Classes
- AnyRef
- def toString(): String
- Definition Classes
- AnyRef → Any
- def unorderedFold[A](fa: F[A])(implicit arg0: CommutativeMonoid[A]): A
- final def wait(): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws(classOf[java.lang.InterruptedException])
- final def wait(arg0: Long, arg1: Int): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws(classOf[java.lang.InterruptedException])
- final def wait(arg0: Long): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws(classOf[java.lang.InterruptedException]) @native()