Packages

trait Deriver[F[_]] extends VersionSpecificDeriver[F]

Deriver builds type class instances based on a Schema.

The minimum set of methods to implement are:

  • deriveRecord
  • deriveEnum
  • derivePrimitive
  • deriveOption
  • deriveSequence
  • deriveMap
  • deriveTransformedRecord (for records with more than 22 fields)

In addition to this more methods can be overridden to handle all the supported Schema types of zio-schema:

  • deriveEither (calls deriveEnum by default)
  • deriveSet (calls deriveSequence by default)
  • deriveTupleN (calls deriveRecord by default)

The cached method converts this deriver to one that uses a cache of instances shared between macro invocations.

Each derive methods get an optional summoned implicit value of the derived type class. It is the deriver's decision whether to use the available instance (as a user defined customization for a given type) or not.

If the decision is to always accept a summoned value if there is any, use the Deriver.AutoAcceptSummoned trait which implements this automatically and only calls the trait's methods in case there is no available implicit for the actual type.

Self Type
Deriver[F]
Linear Supertypes
Ordering
  1. Alphabetic
  2. By Inheritance
Inherited
  1. Deriver
  2. VersionSpecificDeriver
  3. AnyRef
  4. Any
  1. Hide All
  2. Show All
Visibility
  1. Public
  2. Protected

Abstract Value Members

  1. abstract def deriveEnum[A](enum: Enum[A], cases: => Chunk[WrappedF[F, _]], summoned: => Option[F[A]]): F[A]
  2. abstract def deriveMap[K, V](map: Map[K, V], key: => F[K], value: => F[V], summoned: => Option[F[Map[K, V]]]): F[Map[K, V]]
  3. abstract def deriveOption[A](option: Optional[A], inner: => F[A], summoned: => Option[F[Option[A]]]): F[Option[A]]
  4. abstract def derivePrimitive[A](st: StandardType[A], summoned: => Option[F[A]]): F[A]
  5. abstract def deriveRecord[A](record: Record[A], fields: => Chunk[WrappedF[F, _]], summoned: => Option[F[A]]): F[A]
  6. abstract def deriveSequence[C[_], A](sequence: Sequence[C[A], A, _], inner: => F[A], summoned: => Option[F[C[A]]]): F[C[A]]
  7. abstract def deriveTransformedRecord[A, B](record: Record[A], transform: Transform[A, B, _], fields: => Chunk[WrappedF[F, _]], summoned: => Option[F[B]]): F[B]

Concrete Value Members

  1. final def !=(arg0: Any): Boolean
    Definition Classes
    AnyRef → Any
  2. final def ##: Int
    Definition Classes
    AnyRef → Any
  3. final def ==(arg0: Any): Boolean
    Definition Classes
    AnyRef → Any
  4. final def asInstanceOf[T0]: T0
    Definition Classes
    Any
  5. def autoAcceptSummoned: Deriver[F]
  6. lazy val cached: Deriver[F]
  7. def clone(): AnyRef
    Attributes
    protected[lang]
    Definition Classes
    AnyRef
    Annotations
    @throws(classOf[java.lang.CloneNotSupportedException]) @native()
  8. def deriveEither[A, B](either: Either[A, B], left: => F[A], right: => F[B], summoned: => Option[F[Either[A, B]]]): F[Either[A, B]]
  9. def derivePrimitiveAlias[A, U](st: StandardType[U], summoned: => Option[F[A]])(implicit arg0: ClassTag[A]): F[A]
    Annotations
    @nowarn()
  10. def deriveSet[A](set: Set[A], inner: => F[A], summoned: => Option[F[Set[A]]]): F[Set[A]]
  11. def deriveTupleN[T](schemasAndInstances: => Chunk[(Schema[_], WrappedF[F, _])], summoned: => Option[F[T]]): F[T]
  12. def deriveUnknown[A](summoned: => Option[F[A]])(implicit arg0: ClassTag[A]): F[A]
  13. final def eq(arg0: AnyRef): Boolean
    Definition Classes
    AnyRef
  14. def equals(arg0: AnyRef): Boolean
    Definition Classes
    AnyRef → Any
  15. def finalize(): Unit
    Attributes
    protected[lang]
    Definition Classes
    AnyRef
    Annotations
    @throws(classOf[java.lang.Throwable])
  16. final def getClass(): Class[_ <: AnyRef]
    Definition Classes
    AnyRef → Any
    Annotations
    @native()
  17. def hashCode(): Int
    Definition Classes
    AnyRef → Any
    Annotations
    @native()
  18. final def isInstanceOf[T0]: Boolean
    Definition Classes
    Any
  19. final def ne(arg0: AnyRef): Boolean
    Definition Classes
    AnyRef
  20. final def notify(): Unit
    Definition Classes
    AnyRef
    Annotations
    @native()
  21. final def notifyAll(): Unit
    Definition Classes
    AnyRef
    Annotations
    @native()
  22. final def synchronized[T0](arg0: => T0): T0
    Definition Classes
    AnyRef
  23. def toString(): String
    Definition Classes
    AnyRef → Any
  24. def tryDeriveEnum[A](schema: Schema[A], cases: => Chunk[WrappedF[F, _]], summoned: => Option[F[A]])(implicit arg0: ClassTag[A]): F[A]
  25. def tryDeriveRecord[A](schema: Schema[A], fields: => Chunk[WrappedF[F, _]], summoned: => Option[F[A]])(implicit arg0: ClassTag[A]): F[A]
  26. final def wait(): Unit
    Definition Classes
    AnyRef
    Annotations
    @throws(classOf[java.lang.InterruptedException])
  27. final def wait(arg0: Long, arg1: Int): Unit
    Definition Classes
    AnyRef
    Annotations
    @throws(classOf[java.lang.InterruptedException])
  28. final def wait(arg0: Long): Unit
    Definition Classes
    AnyRef
    Annotations
    @throws(classOf[java.lang.InterruptedException]) @native()

Inherited from VersionSpecificDeriver[F]

Inherited from AnyRef

Inherited from Any

Ungrouped