UnsafeOptics

io.circe.optics.UnsafeOptics
object UnsafeOptics

Attributes

Source
JsonPath.scala
Graph
Supertypes
class Object
trait Matchable
class Any
Self type

Members list

Value members

Concrete methods

def optionParse[A](implicit decode: Decoder[A], encode: Encoder[A]): Prism[Option[Json], Option[A]]

Attributes

Source
JsonPath.scala
def parse[A](implicit decode: Decoder[A], encode: Encoder[A]): Prism[Json, A]

Decode a value at the current location.

Decode a value at the current location.

Note that this operation is not lawful, since decoding is not injective (as noted by Julien Truffaut). It is provided here for convenience, but may change in future versions.

Attributes

Source
JsonPath.scala
def select[A](p: A => Boolean): Prism[A, A]

Select if a value matches a predicate

Select if a value matches a predicate

Note that this operation is not lawful because the predicate could be invalidated with set or modify. However select(_.a > 10) composeLens b is safe because once we zoom into b, we cannot change a anymore.

Attributes

Source
JsonPath.scala

Concrete fields

final val keyMissingNone: Option[None.type]

Decode a value at the current location.

Decode a value at the current location. But give Option[A] instead of A in order to treat non-exist field as None

Note that this operation is not lawful, since the same reason as above It is provided here for convenience, but may change in future versions.

Attributes

Source
JsonPath.scala