zio.schema

package zio.schema

Type members

Classlikes

object Derive
trait Deriver[F[_]]

Deriver builds type class instances based on a Schema.

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.

Companion:
object
object Deriver
Companion:
class
class ReflectionUtils[Q <: Quotes & Singleton](val q: Q)