Traversal

zio.blocks.schema.Traversal
See theTraversal companion trait
object Traversal

Constructors for Traversal: compositions of two optics that give a traversal, and traversals over sequences and maps.

Attributes

Companion
trait
Source
Optic.scala
Graph
Supertypes
trait Sum
trait Mirror
class Object
trait Matchable
class Any
Self type
Traversal.type

Members list

Type members

Inherited and Abstract types

type MirroredElemLabels <: Tuple

The names of the product elements.

The names of the product elements.

Attributes

Inherited from:
Mirror
Source
Mirror.scala
type MirroredLabel <: String

The name of the type.

The name of the type.

Attributes

Inherited from:
Mirror
Source
Mirror.scala

Value members

Concrete methods

def apply[S, T, A](first: Traversal[S, T], second: Traversal[T, A]): Traversal[S, A]

Composes two traversals. The same as first(second).

Composes two traversals. The same as first(second).

Attributes

Source
Optic.scala
def apply[S, T, A](first: Traversal[S, T], second: Lens[T, A]): Traversal[S, A]

Composes a traversal with a lens. The same as first(second).

Composes a traversal with a lens. The same as first(second).

Attributes

Source
Optic.scala
def apply[S, T, A <: T](first: Traversal[S, T], second: Prism[T, A]): Traversal[S, A]

Composes a traversal with a prism. The same as first(second).

Composes a traversal with a prism. The same as first(second).

Attributes

Source
Optic.scala
def apply[S, T, A](first: Traversal[S, T], second: Optional[T, A]): Traversal[S, A]

Composes a traversal with an optional. The same as first(second).

Composes a traversal with an optional. The same as first(second).

Attributes

Source
Optic.scala
def apply[S, T, A](first: Lens[S, T], second: Traversal[T, A]): Traversal[S, A]

Composes a lens with a traversal. The same as first(second).

Composes a lens with a traversal. The same as first(second).

Attributes

Source
Optic.scala
def apply[S, T <: S, A](first: Prism[S, T], second: Traversal[T, A]): Traversal[S, A]

Composes a prism with a traversal. The same as first(second).

Composes a prism with a traversal. The same as first(second).

Attributes

Source
Optic.scala
def apply[S, T, A](first: Optional[S, T], second: Traversal[T, A]): Traversal[S, A]

Composes an optional with a traversal. The same as first(second).

Composes an optional with a traversal. The same as first(second).

Attributes

Source
Optic.scala
def atIndices[A, C[_]](seq: Bound[A, C], indices: Seq[Int]): Traversal[C[A], A]

Creates a traversal on the elements at indices of a sequence, visited in increasing index order whatever the order of indices. Indices past the end of a sequence are skipped; check reports them as OpticCheck.SequenceIndexOutOfBounds. When another step follows atIndices and the sequence is not indexed (a List, for example), check also reports reachable indices after the first as out of bounds; fold and modify are not affected (a bug, see docs/dev/issues.md).

Creates a traversal on the elements at indices of a sequence, visited in increasing index order whatever the order of indices. Indices past the end of a sequence are skipped; check reports them as OpticCheck.SequenceIndexOutOfBounds. When another step follows atIndices and the sequence is not indexed (a List, for example), check also reports reachable indices after the first as out of bounds; fold and modify are not affected (a bug, see docs/dev/issues.md).

Attributes

Throws
java.lang.IllegalArgumentException

if seq or indices is null, indices is empty, or it holds a negative or a repeated index

Source
Optic.scala
def atKeys[K, V, M[_, _]](map: Bound[K, V, M], keys: Seq[K]): Traversal[M[K, V], V]

Creates a traversal on the values at keys in a map, visited in the order of keys. Keys the map does not have are skipped; check reports them as OpticCheck.MissingKey.

Creates a traversal on the values at keys in a map, visited in the order of keys. Keys the map does not have are skipped; check reports them as OpticCheck.MissingKey.

Attributes

Throws
java.lang.IllegalArgumentException

if map or keys is null, or keys is empty

Source
Optic.scala
def listValues[A](reflect: Bound[A]): Traversal[List[A], A]

Creates a traversal over every element of a List whose elements have the schema reflect.

Creates a traversal over every element of a List whose elements have the schema reflect.

Attributes

Throws
Source
Optic.scala
def mapKeys[K, V, M[_, _]](map: Bound[K, V, M]): Traversal[M[K, V], K]

Creates a traversal over every key of a map. modify rebuilds the map with the new keys.

Creates a traversal over every key of a map. modify rebuilds the map with the new keys.

Attributes

Throws
Source
Optic.scala
def mapValues[K, V, M[_, _]](map: Bound[K, V, M]): Traversal[M[K, V], V]

Creates a traversal over every value of a map.

Creates a traversal over every value of a map.

Attributes

Throws
Source
Optic.scala
def seqValues[A, C[_]](seq: Bound[A, C]): Traversal[C[A], A]

Creates a traversal over every element of a sequence, such as a List, Vector, Set or Chunk.

Creates a traversal over every element of a sequence, such as a List, Vector, Set or Chunk.

Attributes

Throws
Source
Optic.scala
def setValues[A](reflect: Bound[A]): Traversal[Set[A], A]

Creates a traversal over every element of a Set whose elements have the schema reflect.

Creates a traversal over every element of a Set whose elements have the schema reflect.

Attributes

Throws
Source
Optic.scala
def vectorValues[A](reflect: Bound[A]): Traversal[Vector[A], A]

Creates a traversal over every element of a Vector whose elements have the schema reflect.

Creates a traversal over every element of a Vector whose elements have the schema reflect.

Attributes

Throws
Source
Optic.scala