trait NonEmptyForEach[F[+_]] extends ForEach[F]
A NonEmptyForEach
describes a ForEach
that is guaranteed to
contain at least one element, such as a NonEmptyList
, a NonEmptyChunk
,
or certain tree like data structures.
Because of the additional information that there is always at least one
element, certain operations are available on a NonEmptyForEach
that
are not available on a ForEach
. For example, if an ordering is
defined on the elements of a NonEmptyForEach
then min
and max
are
defined, whereas for a ForEach
only minOption
and maxOption
would
be, since the collection might not contain any elements at all.
- Alphabetic
- By Inheritance
- NonEmptyForEach
- ForEach
- Covariant
- Invariant
- CovariantSubset
- AnyRef
- Any
- Hide All
- Show All
- Public
- Protected
Abstract Value Members
- abstract def forEach1[G[+_], A, B](fa: F[A])(f: (A) => G[B])(implicit arg0: AssociativeBoth[G], arg1: Covariant[G]): G[F[B]]
Traverse each element in the collection using the specified effectual function
f
, returning a new collection with the results in the context of the effect.
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()
- final def compose[G[+_]](implicit arg0: ForEach[G]): ForEach[[+A]F[G[A]]]
- Definition Classes
- ForEach
- final def compose[G[-_]](implicit g: Contravariant[G]): Contravariant[[-A]F[G[A]]]
Compose covariant and contravariant functors.
Compose covariant and contravariant functors.
- Definition Classes
- Covariant
- final def compose[G[+_]](implicit g: Covariant[G]): Covariant[[+A]F[G[A]]]
Compose two covariant functors.
Compose two covariant functors.
- Definition Classes
- Covariant
- final def compose[G[_]](implicit g: Invariant[G]): Invariant[[A]F[G[A]]]
Compose two invariant functors.
Compose two invariant functors.
- Definition Classes
- Invariant
- def compositionLaw[A, B, C](fa: F[A], f: <=>[A, B], g: <=>[B, C])(implicit equal: Equal[F[C]]): Boolean
- Definition Classes
- Invariant
- def concatenate[A](fa: F[A])(implicit arg0: Identity[A]): A
Reduces the collection to a summary value using the associative operation.
Reduces the collection to a summary value using the associative operation. Alias for
fold
.- Definition Classes
- ForEach
- def contains[A, A1 >: A](fa: F[A])(a: A1)(implicit A: Equal[A1]): Boolean
Returns whether the collection contains the specified element.
Returns whether the collection contains the specified element.
- Definition Classes
- ForEach
- def count[A](fa: F[A])(f: (A) => Boolean): Int
Returns the number of elements in the collection that satisfy the specified predicate.
Returns the number of elements in the collection that satisfy the specified predicate.
- Definition Classes
- ForEach
- final def eq(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef
- def equals(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef → Any
- def exists[A](fa: F[A])(f: (A) => Boolean): Boolean
Returns whether any element of the collection satisfies the specified predicate.
Returns whether any element of the collection satisfies the specified predicate.
- Definition Classes
- ForEach
- def finalize(): Unit
- Attributes
- protected[lang]
- Definition Classes
- AnyRef
- Annotations
- @throws(classOf[java.lang.Throwable])
- def find[A](fa: F[A])(f: (A) => Boolean): Option[A]
Returns the first element in the collection satisfying the specified predicate if one exists or
None
otherwise.Returns the first element in the collection satisfying the specified predicate if one exists or
None
otherwise.- Definition Classes
- ForEach
- def flip[G[+_], A](fa: F[G[A]])(implicit arg0: IdentityBoth[G], arg1: Covariant[G]): G[F[A]]
Converts a collection with elements that are in the context of effects to a collection of elements in the context of an effect.
Converts a collection with elements that are in the context of effects to a collection of elements in the context of an effect.
- Definition Classes
- ForEach
- def flip1[G[+_], A](fa: F[G[A]])(implicit arg0: AssociativeBoth[G], arg1: Covariant[G]): G[F[A]]
Converts a collection with elements that are in the context of effects to a collection of elements in the context of an effect.
- def fold[A](fa: F[A])(implicit arg0: Identity[A]): A
Folds over the elements of this collection using an associative operation and an identity.
Folds over the elements of this collection using an associative operation and an identity. Alias for
reduceIdentity
.- Definition Classes
- ForEach
- def foldLeft[S, A](fa: F[A])(s: S)(f: (S, A) => S): S
Folds over the elements of this collection from left to right to produce a summary value, maintaining some internal state along the way.
Folds over the elements of this collection from left to right to produce a summary value, maintaining some internal state along the way.
- Definition Classes
- ForEach
- def foldLeftM[G[+_], S, A](fa: F[A])(s: S)(f: (S, A) => G[S])(implicit arg0: IdentityFlatten[G], arg1: Covariant[G]): G[S]
Effectually fold over the elements of this collection from left to right to produce a summary value, maintaining some internal state along the way.
Effectually fold over the elements of this collection from left to right to produce a summary value, maintaining some internal state along the way.
- Definition Classes
- ForEach
- def foldMap[A, B](fa: F[A])(f: (A) => B)(implicit arg0: Identity[B]): B
Maps each element of the collection to a type
B
for which anIdentity
is defined using the functionf
, then reduces those values to a single summary using thecombine
operation ofIdentity
, or theidentity
element if the collection is empty.Maps each element of the collection to a type
B
for which anIdentity
is defined using the functionf
, then reduces those values to a single summary using thecombine
operation ofIdentity
, or theidentity
element if the collection is empty.- Definition Classes
- ForEach
- def foldMapM[G[+_], A, B](fa: F[A])(f: (A) => G[B])(implicit arg0: Covariant[G], arg1: IdentityFlatten[G], arg2: Identity[B]): G[B]
Effectfully maps each element of the collection to a type
B
for which anIdentity
is defined using the functionf
, then reduces those values to a single summary using thecombine
operation ofIdentity
, or theidentity
element if the collection is empty.Effectfully maps each element of the collection to a type
B
for which anIdentity
is defined using the functionf
, then reduces those values to a single summary using thecombine
operation ofIdentity
, or theidentity
element if the collection is empty.- Definition Classes
- ForEach
- def foldRight[S, A](fa: F[A])(s: S)(f: (A, S) => S): S
Folds over the elements of this collection from right to left to produce a summary value, maintaining some internal state along the way.
Folds over the elements of this collection from right to left to produce a summary value, maintaining some internal state along the way.
- Definition Classes
- ForEach
- def foldRightM[G[+_], S, A](fa: F[A])(s: S)(f: (A, S) => G[S])(implicit arg0: IdentityFlatten[G], arg1: Covariant[G]): G[S]
Effectually fold over the elements of this collection from right to left to produce a summary value, maintaining some internal state along the way.
Effectually fold over the elements of this collection from right to left to produce a summary value, maintaining some internal state along the way.
- Definition Classes
- ForEach
- def forEach[G[+_], A, B](fa: F[A])(f: (A) => G[B])(implicit arg0: IdentityBoth[G], arg1: Covariant[G]): G[F[B]]
Traverse each element in the collection using the specified effectual function
f
, returning a new collection with the results in the context of the effect.Traverse each element in the collection using the specified effectual function
f
, returning a new collection with the results in the context of the effect.- Definition Classes
- NonEmptyForEach → ForEach
- def forEach1_[G[+_], A](fa: F[A])(f: (A) => G[Any])(implicit arg0: AssociativeBoth[G], arg1: Covariant[G]): G[Unit]
Traverses each element in the collection with the specified effectual function
f
purely for its effects. - def forEach_[G[+_], A](fa: F[A])(f: (A) => G[Any])(implicit arg0: IdentityBoth[G], arg1: Covariant[G]): G[Unit]
Traverses each element in the collection with the specified effectual function
f
purely for its effects.Traverses each element in the collection with the specified effectual function
f
purely for its effects.- Definition Classes
- ForEach
- def forall[A](fa: F[A])(f: (A) => Boolean): Boolean
Returns whether any element of the collection satisfies the specified predicate.
Returns whether any element of the collection satisfies the specified predicate.
- Definition Classes
- ForEach
- def fproduct[A, B](f: (A) => B): (F[A]) => F[(A, B)]
- Definition Classes
- Covariant
- def fproductLeft[A, B](f: (A) => B): (F[A]) => F[(B, A)]
- Definition Classes
- Covariant
- final def getClass(): Class[_ <: AnyRef]
- Definition Classes
- AnyRef → Any
- Annotations
- @native()
- def groupByNonEmpty[V, K](fa: F[V])(f: (V) => K): Map[K, NonEmptyChunk[V]]
- Definition Classes
- ForEach
- def groupByNonEmptyM[G[+_], V, K](fa: F[V])(f: (V) => G[K])(implicit arg0: IdentityBoth[G], arg1: Covariant[G]): G[Map[K, NonEmptyChunk[V]]]
- Definition Classes
- ForEach
- def hashCode(): Int
- Definition Classes
- AnyRef → Any
- Annotations
- @native()
- def identityLaw1[A](fa: F[A])(implicit equal: Equal[F[A]]): Boolean
- Definition Classes
- Invariant
- def intersperse[A](fa: F[A], middle: A)(implicit I: Identity[A]): A
Folds over the elements of this collection using an associative operation with the middle element interspersed between every element.
Folds over the elements of this collection using an associative operation with the middle element interspersed between every element.
- Definition Classes
- ForEach
- final def invmap[A, B](f: <=>[A, B]): <=>[F[A], F[B]]
- def isEmpty[A](fa: F[A]): Boolean
Returns whether the collection is empty.
Returns whether the collection is empty.
- Definition Classes
- ForEach
- final def isInstanceOf[T0]: Boolean
- Definition Classes
- Any
- def map[A, B](f: (A) => B): (F[A]) => F[B]
Lifts a function operating on values to a function that operates on each element of a collection.
- def mapAccum[S, A, B](fa: F[A])(s: S)(f: (S, A) => (S, B)): (S, F[B])
Statefully maps over the elements of the collection, maintaining some state along the way and returning the final state along with the new collection.
Statefully maps over the elements of the collection, maintaining some state along the way and returning the final state along with the new collection.
- Definition Classes
- ForEach
- final def mapSubset[A, B](f: (A) => B)(implicit arg0: AnyType[B]): (F[A]) => F[B]
- Definition Classes
- Covariant → CovariantSubset
- def max[A](fa: F[A])(implicit arg0: Ord[A]): A
Returns the largest value in the collection if one exists or
None
otherwise. - def maxBy[A, B](fa: F[A])(f: (A) => B)(implicit arg0: Ord[B]): A
Returns the largest element in the collection if one exists, using the function
f
to map each element to a type for which anOrd
is defined, orNone
otherwise. - def maxByOption[A, B](fa: F[A])(f: (A) => B)(implicit arg0: Ord[B]): Option[A]
Returns the largest element in the collection if one exists, using the function
f
to map each element to a type for which anOrd
is defined, orNone
otherwise.Returns the largest element in the collection if one exists, using the function
f
to map each element to a type for which anOrd
is defined, orNone
otherwise.- Definition Classes
- ForEach
- def maxOption[A](fa: F[A])(implicit arg0: Ord[A]): Option[A]
Returns the largest value in the collection if one exists or
None
otherwise.Returns the largest value in the collection if one exists or
None
otherwise.- Definition Classes
- ForEach
- def min[A](fa: F[A])(implicit arg0: Ord[A]): A
Returns the smallest value in the collection if one exists or
None
otherwise. - def minBy[A, B](fa: F[A])(f: (A) => B)(implicit arg0: Ord[B]): A
Returns the smallest element in the collection if one exists, using the function
f
to map each element to a type for which anOrd
is defined, orNone
otherwise. - def minByOption[A, B](fa: F[A])(f: (A) => B)(implicit arg0: Ord[B]): Option[A]
Returns the smallest element in the collection if one exists, using the function
f
to map each element to a type for which anOrd
is defined, orNone
otherwise.Returns the smallest element in the collection if one exists, using the function
f
to map each element to a type for which anOrd
is defined, orNone
otherwise.- Definition Classes
- ForEach
- def minOption[A](fa: F[A])(implicit arg0: Ord[A]): Option[A]
Returns the smallest value in the collection if one exists or
None
otherwise.Returns the smallest value in the collection if one exists or
None
otherwise.- Definition Classes
- ForEach
- final def ne(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef
- def nonEmpty[A](fa: F[A]): Boolean
Returns whether the collection contains at least one element
Returns whether the collection contains at least one element
- Definition Classes
- ForEach
- final def notify(): Unit
- Definition Classes
- AnyRef
- Annotations
- @native()
- final def notifyAll(): Unit
- Definition Classes
- AnyRef
- Annotations
- @native()
- def partitionMap[A, B, C](fa: F[A])(f: (A) => Either[B, C])(implicit both: IdentityBoth[F], either: IdentityEither[F]): (F[B], F[C])
Partitions the collection based on the specified function.
Partitions the collection based on the specified function.
- Definition Classes
- ForEach
- def partitionMapM[G[+_], A, B, C](fa: F[A])(f: (A) => G[Either[B, C]])(implicit arg0: IdentityFlatten[G], arg1: Covariant[G], both: IdentityBoth[F], either: IdentityEither[F]): G[(F[B], F[C])]
Partitions the collection based on the specified effectual function.
Partitions the collection based on the specified effectual function.
- Definition Classes
- ForEach
- def partitionMapV[W, E, A, B](fa: F[A])(f: (A) => ZValidation[W, E, B])(implicit both: IdentityBoth[F], either: IdentityEither[F]): (F[E], F[B])
Partitions the collection based on the specified validation function.
Partitions the collection based on the specified validation function.
- Definition Classes
- ForEach
- def product[A](fa: F[A])(implicit ev: Identity[Prod[A]]): A
Returns the product of all elements in the collection.
Returns the product of all elements in the collection.
- Definition Classes
- ForEach
- def reduce1[A](fa: F[A])(implicit arg0: Associative[A]): A
Reduces the non-empty collection of associative elements.
- def reduceAll[A](fa: F[A])(f: (A, A) => A): A
Reduces the collection to a summary value using the binary function
f
. - def reduceAssociative[A](fa: F[A])(implicit arg0: Associative[A]): Option[A]
Reduces the collection to a summary value using the associative operation, returning
None
if the collection is empty.Reduces the collection to a summary value using the associative operation, returning
None
if the collection is empty.- Definition Classes
- ForEach
- def reduceIdempotent[A](fa: F[A])(implicit arg0: Idempotent[A], arg1: Equal[A]): Option[A]
Reduces the collection to a summary value using the idempotent operation, returning
None
if the collection is empty.Reduces the collection to a summary value using the idempotent operation, returning
None
if the collection is empty.- Definition Classes
- ForEach
- def reduceIdempotent1[A](fa: F[A])(implicit arg0: Idempotent[A], arg1: Equal[A]): A
Reduces the collection to a summary value using the idempotent operation, returning
None
if the collection is empty. - def reduceIdentity[A](fa: F[A])(implicit arg0: Identity[A]): A
Reduces the collection to a summary value using the associative operation.
Reduces the collection to a summary value using the associative operation. Alias for
fold
.- Definition Classes
- ForEach
- def reduceMap[A, B](fa: F[A])(f: (A) => B)(implicit arg0: Associative[B]): B
Maps each element of the collection to a type
B
for which a combine operation is defined using the functionf
and then reduces those values to a single summary using the combine operation. - def reduceMapLeft[A, B](fa: F[A])(map: (A) => B)(reduce: (B, A) => B): B
Reduces the elements of this collection from left to right using the function
map
to transform the first value to the typeB
and then the functionreduceAll
to combine theB
value with each otherA
value. - def reduceMapOption[A, B](fa: F[A])(f: (A) => B)(implicit arg0: Associative[B]): Option[B]
Maps each element of the collection to a type
B
for which an associative operation exists and then reduces the values using the associative operation, returningNone
if the collection is empty.Maps each element of the collection to a type
B
for which an associative operation exists and then reduces the values using the associative operation, returningNone
if the collection is empty.- Definition Classes
- ForEach
- def reduceMapRight[A, B](fa: F[A])(map: (A) => B)(reduce: (A, B) => B): B
Reduces the elements of this colection from right to left using the function
map
to transform the first value to the typeB
and then the functionreduceAll
to combine theB
value with each otherA
value. - def reduceOption[A](fa: F[A])(f: (A, A) => A): Option[A]
Reduces the collection to a summary value using the binary function
f
, returningNone
if the collection is empty.Reduces the collection to a summary value using the binary function
f
, returningNone
if the collection is empty.- Definition Classes
- ForEach
- def reverse[A](fa: F[A]): F[A]
Reverses the order of elements in the collection.
Reverses the order of elements in the collection.
- Definition Classes
- ForEach
- def size[A](fa: F[A]): Int
Returns the number of elements in the collection.
Returns the number of elements in the collection.
- Definition Classes
- ForEach
- def sum[A](fa: F[A])(implicit ev: Identity[Sum[A]]): A
Returns the sum of all elements in the collection.
Returns the sum of all elements in the collection.
- Definition Classes
- ForEach
- final def synchronized[T0](arg0: => T0): T0
- Definition Classes
- AnyRef
- def toChunk[A](fa: F[A]): Chunk[A]
Converts the collection to a
Chunk
.Converts the collection to a
Chunk
.- Definition Classes
- ForEach
- def toList[A](fa: F[A]): List[A]
Converts the collection to a
List
.Converts the collection to a
List
.- Definition Classes
- ForEach
- def toNonEmptyChunk[A](fa: F[A]): NonEmptyChunk[A]
Converts the collection to a
NonEmptyChunk
. - def toNonEmptyList[A](fa: F[A]): NonEmptyList[A]
Converts the collection to a
NonEmptyList
. - def toString(): String
- Definition Classes
- AnyRef → Any
- 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()
- def zipAll[A, B, C](fa: F[A], fb: F[B])(implicit both: IdentityBoth[F], either: IdentityEither[F]): F[These[A, B]]
Zips the left collection and right collection together, using
None
to handle the case where one collection is larger than the other.Zips the left collection and right collection together, using
None
to handle the case where one collection is larger than the other.- Definition Classes
- ForEach
- def zipAllWith[A, B, C](fa: F[A], fb: F[B])(f: (These[A, B]) => C)(implicit both: IdentityBoth[F], either: IdentityEither[F]): F[C]
Zips the left collection and right collection together, using the specified function to handle the cases where one collection is larger than the other.
Zips the left collection and right collection together, using the specified function to handle the cases where one collection is larger than the other.
- Definition Classes
- ForEach
- def zipWithIndex[A](fa: F[A]): F[(A, Int)]
Zips each element of the collection with its index.
Zips each element of the collection with its index.
- Definition Classes
- ForEach