zio.schema

package zio.schema

Members list

Concise view

Type members

Classlikes

object Derive

Attributes

Graph
Supertypes
class Object
trait Matchable
class Any
Self type
Derive.type

Attributes

Graph
Supertypes
class Object
trait Matchable
class Any
Self type
trait Deriver[F[_]] extends VersionSpecificDeriver[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.

Attributes

Companion:
object
Graph
Supertypes
class Object
trait Matchable
class Any
Self type
object Deriver

Attributes

Companion:
trait
Graph
Supertypes
class Object
trait Matchable
class Any
Self type
Deriver.type
class ReflectionUtils[Q <: Quotes & Singleton](val q: Q)

Attributes

Graph
Supertypes
class Object
trait Matchable
class Any

Attributes

Graph
Supertypes
class Object
trait Matchable
class Any
Known subtypes
trait Deriver[F]
Self type

Extensions

Extensions

extension (s: Schema.type)
transparent inline def derived[A]: Schema[A]