Decoder

kantan.codecs.Decoder
See theDecoder companion trait
object Decoder

Attributes

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

Members list

Value members

Concrete methods

def from[E, D, F, T](f: E => Either[F, D]): Decoder[E, D, F, T]

Creates a new Decoder instance that applies the specified function when decoding.

Creates a new Decoder instance that applies the specified function when decoding.

Attributes

Source
Decoder.scala
def fromUnsafe[E, D, F : IsError, T](f: E => D): Decoder[E, D, F, T]

Turns an unsafe function into a Decoder.

Turns an unsafe function into a Decoder.

The specified function is assumed to throw, and errors will be dealt with properly.

Attributes

Source
Decoder.scala
def oneOf[E, D, F : IsError, T](ds: Decoder[E, D, F, T]*): Decoder[E, D, F, T]

Creates a new decoder using all specified values.

Creates a new decoder using all specified values.

The generated decoder will try each of the specified decoders in turn, and return either the first success or, if none is found, the last failure.

Attributes

Source
Decoder.scala

Implicits

Implicits

implicit def decoderFromExported[E, D, F, T](implicit da: DerivedDecoder[E, D, F, T]): Decoder[E, D, F, T]

Attributes

Source
Decoder.scala
implicit def eitherDecoder[E, D1, D2, F, T](implicit d1: Decoder[E, D1, F, T], d2: Decoder[E, D2, F, T]): Decoder[E, Either[D1, D2], F, T]

Provides a Decoder instance for Either[A, B], provided both A and B have a Decoder instance.

Provides a Decoder instance for Either[A, B], provided both A and B have a Decoder instance.

Attributes

Source
Decoder.scala
implicit def optionalDecoder[E : Optional, D, F, T](implicit evidence$1: Optional[E], da: Decoder[E, D, F, T]): Decoder[E, Option[D], F, T]

Attributes

Source
Decoder.scala