Gives a Circe Decoder for the type A
when a way to go from String to A
is provided
Gives a Circe Decoder for the type A
when a way to go from String to A
is provided
Example, Instant:
val instantDecoder: Decoder[Instant] = decoderFor(Instant.parse)
A decoder for A
Gives a Circe Encoder for the type A
when a Show
instance
is available for it.
Gives a Circe Encoder for the type A
when a Show
instance
is available for it.
Example, Instant:
val instantEncoder: Encoder[Instant] = encoderFor[Instant]
Example, Shapeless tag:
def taggedLongEncoder[T]: Encoder[Long @@ T] = encoderFor[Long @@ T]
def taggedStringEncoder[T]: Encoder[String @@ T] = encoderFor[String @@ T]
def taggedBigDecimalEncoder[T]: Encoder[BigDecimal @@ T] = encoderFor[BigDecimal @@ T]
An encoder for A
Gives a Circe Decoder for A
that maps the successful decoded value with f
Gives a Circe Decoder for A
that maps the successful decoded value with f
Example, Shapeless tag:
def taggedLongDecoder[T]: Decoder[Long @@ T] = mappedDecoderFor(_.toLong)(tag[T].apply)
def taggedBigDecimalDecoder[T]: Decoder[BigDecimal @@ T] = mappedDecoderFor(BigDecimal.apply)(tag[T].apply)
def taggedStringDecoder[T]: Decoder[String @@ T] = mappedDecoderFor(identity)(tag[T].apply)
A decoder for A
that maps the result to B
in case of successful decoding