SearchTraversal
zio.blocks.schema.SearchTraversal
object SearchTraversal
Constructors for search traversals, which the searchFor[T] step of CompanionOptics builds.
A search traversal converts the value to a DynamicValue. fold and check visit it depth first, left to right: the value itself, then record fields, case values, sequence elements, and both the keys and the values of maps. modify visits the same nodes except map keys, so a match that is a map key is read but never modified (see docs/dev/issues.md). Every node that decodes with the focus schema is a match, and the children of a match are searched too. modify applies f to each match and decodes the result with the source schema; if that decoding fails, it returns s unchanged. check reports an OpticCheck.EmptySequence when nothing matches.
Attributes
- Source
- Optic.scala
- Graph
-
- Supertypes
- Self type
-
SearchTraversal.type
Members list
In this article