AssociativeFlatten

zio.prelude.AssociativeFlatten
See theAssociativeFlatten companion object
trait AssociativeFlatten[F[_]]

AssociativeFlatten describes a type that can be "flattened" in an associative way. For example, if we have a list of lists of lists, we can flatten it by either flattening the two inner lists and then flattening the resulting lists, or flattening the two outer lists and then flattening that resulting list. Because the operation is associative, the resulting list is the same either way.

Attributes

Companion
object
Graph
Supertypes
class Object
trait Matchable
class Any
Known subtypes

Members list

Value members

Abstract methods

def flatten[A](ffa: F[F[A]]): F[A]

Flattens a value of type F[F[A]] to produce an F[A].

Flattens a value of type F[F[A]] to produce an F[A].

Attributes