A type class that provides a conversion from a value of type A
to a JSON
array.
A type class that provides a conversion from a value of type A
to a
JsonObject.
A subtype of Encoder
that statically verifies that the instance encodes
either a JSON array or an object.
Utilities and instances for AsArray.
Utilities and instances for Encoder.AsObject.
Utilities and instances for AsRoot.
Return an instance for a given type A
.
object WeekDay extends Enumeration { ... } implicit val weekDayEncoder = Encoder.encodeEnumeration(WeekDay)
Note that on Scala.js the encoding of Float
values is subject to the
usual limitations of Float#toString
on that platform (e.g.
Note that on Scala.js the encoding of Float
values is subject to the
usual limitations of Float#toString
on that platform (e.g. 1.1f
will be
encoded as a Json value that will be printed as "1.100000023841858"
).
Construct an instance for a given type with a cats.Foldable instance.
Preserves iteration order.
Preserves iteration order.
Construct an instance from a function.
object WeekDay extends Enumeration { ... } implicit val weekDayEncoder = Encoder.enumEncoder(WeekDay)
(Since version 0.12.0) Use encodeEnumeration
Instance creation methods for disjunction-like types. Note that these instances are not implicit, since they require non-obvious decisions about the names of the discriminators. If you want instances for these types you can include the following import in your program:
import io.circe.disjunctionCodecs._
Utilities and instances for Encoder.