package shapeless
- Source
- package.scala
- Alphabetic
- By Inheritance
- shapeless
- ShapelessInstances
- AnyRef
- Any
- Hide All
- Show All
- Public
- Protected
Type Members
- trait ShapelessInstances extends AnyRef
Provides
Codec
instances for case classes and sum types.Provides
Codec
instances for case classes and sum types.The purpose of this package is to let concrete
Codec
implementations (such as kantan.csv or kantan.regex) focus on providing instances forHList
andCoproduct
. Once such instances exist, this package will take care of the transformation from and to case classes and sum types.Additionally, instances derived that way will be inserted with a sane precedence in the implicit resolution mechanism. This means, for example, that they will not override bespoke
Option
orEither
instances.
Value Members
- implicit def caseClassDecoder[E, D, F, T, H <: HList](implicit gen: Aux[D, H], dr: Lazy[Decoder[E, H, F, T]]): DerivedDecoder[E, D, F, T]
Provides a
Decoder
instance for case classes.Provides a
Decoder
instance for case classes.Given a case class
D
, this expects nDecoder
instance for theHList
type corresponding toD
. It will then rely on that to turn encoded values into anHList
, then turn the resulting value into aD
.- Definition Classes
- ShapelessInstances
- implicit def caseClassDecoderFromLabelled[E, D, F, T, H <: HList](implicit generic: Aux[D, H], hDecoder: Lazy[Decoder[E, H, F, T]]): DerivedDecoder[E, D, F, T]
Similar to caseClassDecoder, but working with
LabelledGeneric
rather than justGeneric
.Similar to caseClassDecoder, but working with
LabelledGeneric
rather than justGeneric
.- Definition Classes
- ShapelessInstances
- implicit def caseClassEncoder[E, D, T, H <: HList](implicit gen: Aux[D, H], er: Lazy[Encoder[E, H, T]]): DerivedEncoder[E, D, T]
Provides an
Encoder
instance for case classes.Provides an
Encoder
instance for case classes.Given a case class
D
, this expects anEncoder
instance for theHList
type corresponding toD
. It will then simply turn values of typeD
into values of the correspondingHList
, then let the encoder take it from there.- Definition Classes
- ShapelessInstances
- implicit def caseClassEncoderFromLabelled[E, D, T, H <: HList](implicit generic: Aux[D, H], hEncoder: Lazy[Encoder[E, H, T]]): DerivedEncoder[E, D, T]
Similar to caseClassEncoder, but working with
LabelledGeneric
rather than justGeneric
.Similar to caseClassEncoder, but working with
LabelledGeneric
rather than justGeneric
.- Definition Classes
- ShapelessInstances
- implicit def cnilDecoder[E, F, T](implicit arg0: IsError[F]): Decoder[E, CNil, F, T]
- Definition Classes
- ShapelessInstances
- implicit def cnilEncoder[E, D, T]: Encoder[E, CNil, T]
- Definition Classes
- ShapelessInstances
- Annotations
- @SuppressWarnings()
- implicit def coproductDecoder[E, H, D <: Coproduct, F, T](implicit dh: Decoder[E, H, F, T], dt: Decoder[E, D, F, T]): Decoder[E, :+:[H, D], F, T]
- Definition Classes
- ShapelessInstances
- implicit def coproductEncoder[E, H, D <: Coproduct, T](implicit eh: Encoder[E, H, T], ed: Encoder[E, D, T]): Encoder[E, :+:[H, D], T]
- Definition Classes
- ShapelessInstances
- implicit def sumTypeDecoder[E, D, F, T, C <: Coproduct](implicit gen: Aux[D, C], dr: Lazy[Decoder[E, C, F, T]]): DerivedDecoder[E, D, F, T]
Provides a
Decoder
instance for sum types.Provides a
Decoder
instance for sum types.Given a case class
D
, this expects nDecoder
instance for theCoproduct
type corresponding toD
. It will then rely on that to turn encoded values into aCoproduct
, then turn the resulting value into aD
.- Definition Classes
- ShapelessInstances
- implicit def sumTypeEncoder[E, D, T, C <: Coproduct](implicit gen: Aux[D, C], er: Lazy[Encoder[E, C, T]]): DerivedEncoder[E, D, T]
Provides an
Encoder
instance for sum types.Provides an
Encoder
instance for sum types.Given a sum type
D
, this expects anEncoder
instance for theCoproduct
type corresponding toD
. It will then simply turn values of typeD
into values of the correspondingCoproduct
, then let the encoder take it from there.- Definition Classes
- ShapelessInstances