EncoderK

smithy4s.capability.EncoderK
See theEncoderK companion object
trait EncoderK[F[_], Result] extends Contravariant[F]

A typeclass abstracting over the notion of encoder. It offers way to go from an encoder type to a function, and vice-versa.

This abstraction is particularly useful when encoding unions : as we need to pre-compile codecs for each union member, and dispatch union instances to a specific codec.

Attributes

Companion
object
Graph
Supertypes
trait Contravariant[F]
class Object
trait Matchable
class Any

Members list

Value members

Abstract methods

def absorb[A](f: A => Result): F[A]
def apply[A](fa: F[A], a: A): Result

Concrete methods

def contramap[A, B](fa: F[A])(f: B => A): F[B]