Each

dev.constructive.eo.optics.Each
object Each

Monocle's Each as a plain constructor object — NOT a typeclass. Each[F, A] is exactly Traversal.each: a Traversal over every element of any cats.Traverse container, provided under the name Monocle users grep for. There is no Each[S, A] typeclass to instance and nothing to derive — the result is an ordinary optic that composes through .andThen and serves capability evidence (CanFold, CanModify) like any other.

Attributes

Source
Each.scala
Graph
Supertypes
class Object
trait Matchable
class Any
Self type
Each.type

Members list

Grouped members

Constructors

def apply[T[_] : Traverse, A]: Traversal[T[A], T[A], A, A]

Traversal over every element of a Traverse container — alias for Traversal.each.

Traversal over every element of a Traverse container — alias for Traversal.each.

Attributes

Example
val everyInt = Each[List, Int]      // ≡ Traversal.each[List, Int]
everyInt.modify(_ + 1)(List(1, 2))  // List(2, 3)
Source
Each.scala