UnorderedFoldable
class UnorderedFoldable[t: Type -> Type]
SourceA trait for unordered data structures that can be folded.
Signatures
def foldMap(f: a -> b \ ef, t: t[a]): b \ ef with UnorderedFoldable[t], CommutativeMonoid[b]
SourceUnordered fold of t
.
Applies f
to all elements in t
and combines the results
i.e. CommutativeMonoid.combine(f(a))
for all a
in t
.
Class Definitions
def count(f: a -> Bool \ ef, t: t[a]): Int32 \ ef with UnorderedFoldable[t]
SourceReturns the number of elements in t
that satisfy the predicate f
.
def exists(f: a -> Bool \ ef, t: t[a]): Bool \ ef with UnorderedFoldable[t]
SourceReturns true
if and only if at least one element in t
satisfies the predicate f
.
Returns false
if t
is empty.
def fold(t: t[a]): a with UnorderedFoldable[t], CommutativeMonoid[a]
SourceReturns the result of applying CommutativeMonoid.combine
to all the elements in t
.
def forAll(f: a -> Bool \ ef, t: t[a]): Bool \ ef with UnorderedFoldable[t]
SourceReturns true
if and only if all elements in t
satisfy the predicate f
.
Returns true
if t
is empty.
def isEmpty(t: t[a]): Bool with UnorderedFoldable[t]
SourceReturns true if and only if t
is empty.
def memberOf(x: a, t: t[a]): Bool with UnorderedFoldable[t], Eq[a]
SourceReturns true
if and only if the element x
is in t
.
def size(t: t[a]): Int32 with UnorderedFoldable[t]
SourceReturns the number of elements in t
.