Packages

trait Deriver[F[_]] extends AnyRef

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. AnyRef
  3. 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 deriveSet[A](set: Set[A], inner: => F[A], summoned: => Option[F[Set[A]]]): F[Set[A]]
  10. def deriveTupleN[T](schemasAndInstances: => Chunk[(Schema[_], WrappedF[F, _])], summoned: => Option[F[T]]): F[T]
  11. final def eq(arg0: AnyRef): Boolean
    Definition Classes
    AnyRef
  12. def equals(arg0: AnyRef): Boolean
    Definition Classes
    AnyRef → Any
  13. def finalize(): Unit
    Attributes
    protected[lang]
    Definition Classes
    AnyRef
    Annotations
    @throws(classOf[java.lang.Throwable])
  14. final def getClass(): Class[_ <: AnyRef]
    Definition Classes
    AnyRef → Any
    Annotations
    @native()
  15. def hashCode(): Int
    Definition Classes
    AnyRef → Any
    Annotations
    @native()
  16. final def isInstanceOf[T0]: Boolean
    Definition Classes
    Any
  17. final def ne(arg0: AnyRef): Boolean
    Definition Classes
    AnyRef
  18. final def notify(): Unit
    Definition Classes
    AnyRef
    Annotations
    @native()
  19. final def notifyAll(): Unit
    Definition Classes
    AnyRef
    Annotations
    @native()
  20. final def synchronized[T0](arg0: => T0): T0
    Definition Classes
    AnyRef
  21. def toString(): String
    Definition Classes
    AnyRef → Any
  22. final def wait(): Unit
    Definition Classes
    AnyRef
    Annotations
    @throws(classOf[java.lang.InterruptedException])
  23. final def wait(arg0: Long, arg1: Int): Unit
    Definition Classes
    AnyRef
    Annotations
    @throws(classOf[java.lang.InterruptedException])
  24. final def wait(arg0: Long): Unit
    Definition Classes
    AnyRef
    Annotations
    @throws(classOf[java.lang.InterruptedException]) @native()

Inherited from AnyRef

Inherited from Any

Ungrouped