ReflectTransformer

zio.blocks.schema.ReflectTransformer
See theReflectTransformer companion object
trait ReflectTransformer[-F[_, _], G[_, _]]

Rebuilds a Reflect tree with G in place of F at every node, through Reflect#transform. That method walks the tree and transforms the children of a node first; a transformer says how to rebuild each kind of node from its transformed children and the F it held. Reflect.Deferred nodes have no method of their own: Reflect.Deferred#transform handles them.

ReflectTransformer.noBinding strips the bindings of a reflect, DynamicSchema#rebind attaches them back, and type class derivation pairs each binding with a derived instance. Extend ReflectTransformer.OnlyMetadata when only the metadata changes.

Type parameters

F

what the nodes of the source reflect hold

G

what the nodes of the result hold

Attributes

See also
Companion
object
Source
ReflectTransformer.scala
Graph
Supertypes
class Object
trait Matchable
class Any
Known subtypes
class OnlyMetadata[F, G]
trait HasBinding[F]

Members list

Value members

Abstract methods

def transformDynamic(path: DynamicOptic, typeId: TypeId[DynamicValue], metadata: F[Dynamic, DynamicValue], doc: Doc, modifiers: Seq[Reflect], storedDefaultValue: Option[DynamicValue], storedExamples: Seq[DynamicValue]): Lazy[Dynamic[G]]

Rebuilds a dynamic node. path is the location of the node and metadata what it holds in the source reflect. The other parameters are its type ID, documentation, modifiers, default value and examples, which the new node usually keeps.

Rebuilds a dynamic node. path is the location of the node and metadata what it holds in the source reflect. The other parameters are its type ID, documentation, modifiers, default value and examples, which the new node usually keeps.

Attributes

Source
ReflectTransformer.scala
def transformMap[Key, Value, M[_, _]](path: DynamicOptic, key: Reflect[G, Key], value: Reflect[G, Value], typeId: TypeId[M[Key, Value]], metadata: F[Map[M], M[Key, Value]], doc: Doc, modifiers: Seq[Reflect], storedDefaultValue: Option[DynamicValue], storedExamples: Seq[DynamicValue]): Lazy[Map[G, Key, Value, M]]

Rebuilds a map node from its transformed key and value nodes. path is the location of the node and metadata what it holds in the source reflect. The other parameters are its type ID, documentation, modifiers, default value and examples, which the new node usually keeps.

Rebuilds a map node from its transformed key and value nodes. path is the location of the node and metadata what it holds in the source reflect. The other parameters are its type ID, documentation, modifiers, default value and examples, which the new node usually keeps.

Attributes

Source
ReflectTransformer.scala
def transformPrimitive[A](path: DynamicOptic, primitiveType: PrimitiveType[A], typeId: TypeId[A], metadata: F[Primitive, A], doc: Doc, modifiers: Seq[Reflect], storedDefaultValue: Option[DynamicValue], storedExamples: Seq[DynamicValue]): Lazy[Primitive[G, A]]

Rebuilds a primitive node of primitiveType. path is the location of the node and metadata what it holds in the source reflect. The other parameters are its type ID, documentation, modifiers, default value and examples, which the new node usually keeps.

Rebuilds a primitive node of primitiveType. path is the location of the node and metadata what it holds in the source reflect. The other parameters are its type ID, documentation, modifiers, default value and examples, which the new node usually keeps.

Attributes

Source
ReflectTransformer.scala
def transformRecord[A](path: DynamicOptic, fields: IndexedSeq[Term[G, A, _]], typeId: TypeId[A], metadata: F[Record, A], doc: Doc, modifiers: Seq[Reflect], storedDefaultValue: Option[DynamicValue], storedExamples: Seq[DynamicValue]): Lazy[Record[G, A]]

Rebuilds a record node from its transformed fields. path is the location of the node and metadata what it holds in the source reflect. The other parameters are its type ID, documentation, modifiers, default value and examples, which the new node usually keeps.

Rebuilds a record node from its transformed fields. path is the location of the node and metadata what it holds in the source reflect. The other parameters are its type ID, documentation, modifiers, default value and examples, which the new node usually keeps.

Attributes

Source
ReflectTransformer.scala
def transformSequence[A, C[_]](path: DynamicOptic, element: Reflect[G, A], typeId: TypeId[C[A]], metadata: F[Seq[C], C[A]], doc: Doc, modifiers: Seq[Reflect], storedDefaultValue: Option[DynamicValue], storedExamples: Seq[DynamicValue]): Lazy[Sequence[G, A, C]]

Rebuilds a sequence node from its transformed element node. path is the location of the node and metadata what it holds in the source reflect. The other parameters are its type ID, documentation, modifiers, default value and examples, which the new node usually keeps.

Rebuilds a sequence node from its transformed element node. path is the location of the node and metadata what it holds in the source reflect. The other parameters are its type ID, documentation, modifiers, default value and examples, which the new node usually keeps.

Attributes

Source
ReflectTransformer.scala
def transformVariant[A](path: DynamicOptic, cases: IndexedSeq[Term[G, A, _ <: A]], typeId: TypeId[A], metadata: F[Variant, A], doc: Doc, modifiers: Seq[Reflect], storedDefaultValue: Option[DynamicValue], storedExamples: Seq[DynamicValue]): Lazy[Variant[G, A]]

Rebuilds a variant node from its transformed cases. path is the location of the node and metadata what it holds in the source reflect. The other parameters are its type ID, documentation, modifiers, default value and examples, which the new node usually keeps.

Rebuilds a variant node from its transformed cases. path is the location of the node and metadata what it holds in the source reflect. The other parameters are its type ID, documentation, modifiers, default value and examples, which the new node usually keeps.

Attributes

Source
ReflectTransformer.scala
def transformWrapper[A, B](path: DynamicOptic, wrapped: Reflect[G, B], typeId: TypeId[A], metadata: F[Wrapper[A, B], A], doc: Doc, modifiers: Seq[Reflect], storedDefaultValue: Option[DynamicValue], storedExamples: Seq[DynamicValue]): Lazy[Wrapper[G, A, B]]

Rebuilds a wrapper node from its transformed wrapped node, which has the same path. path is the location of the node and metadata what it holds in the source reflect. The other parameters are its type ID, documentation, modifiers, default value and examples, which the new node usually keeps.

Rebuilds a wrapper node from its transformed wrapped node, which has the same path. path is the location of the node and metadata what it holds in the source reflect. The other parameters are its type ID, documentation, modifiers, default value and examples, which the new node usually keeps.

Attributes

Source
ReflectTransformer.scala