@implicitNotFound("Could not find an instance of UnorderedFoldable for ${F}") @typeclass trait UnorderedFoldable[F[_]] extends Serializable
UnorderedFoldable
is like a Foldable
for unordered containers.
UnorderedFoldable
is like a Foldable
for unordered containers.
- Companion
- object
trait Serializable
class Object
trait Matchable
class Any
trait Foldable[F]
trait Reducible[F]
trait NonEmptyTraverse[F]
trait Traverse[F]
trait UnorderedTraverse[F]
Value members
Abstract methods
Concrete methods
@noop
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
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
.
Check whether all elements satisfy the predicate.
Check whether all elements satisfy the predicate.
If there are no elements, the result is true
.
Returns true if there are no elements. Otherwise false.
Returns true if there are no elements. Otherwise false.