Right biased Either[Err, A]
.
Supports encoding a value of type A
to a BitVector
and decoding a BitVector
to a value of A
.
Result of a decoding operation, which consists of the decoded value and the remaining bits that were not consumed by decoding.
Supports decoding a value of type A
from a BitVector
.
Provides functions for working with decoders.
Provides the ability to sequence decoding operations such that the remainder of an operation is fed in to the input of the next operation.
Supports encoding a value of type A
to a BitVector
.
Provides functions for working with encoders.
Provides methods specific to decoders of Shapeless coproducts.
Provides methods specific to encoders of Shapeless coproducts.
Provides additional methods on HList
s.
Describes an error.
Generalized codec that allows the type to encode to vary from the type to decode.
Provides common operations on a Codec[HList]
.
Typeclass that describes type constructors that support the exmap
operation.
Provides method syntax for working with a type constructor that has a Transform typeclass instance.
Witness operation that supports transforming an F[A]
to an F[B]
for all F
which have a Transform
instance available.
Low priority Transformer
builders.
Provides syntax related to generic programming for codecs of any type.
Provides HList
related syntax for codecs of any type.
Companion for Attempt.
This object was generated by sbt-buildinfo.
Companion for Codec.
Companion for Decoder.
Provides constructors for DecodingContext
.
Companion for Encoder.
Companion for Err.
Companion for GenCodec.
Companion for Transform.
Companion for Transformer.
Provides codecs for common types and combinators for building larger codecs.
Combinator library for working with binary data.
The primary abstraction of this library is Codec, which provides the ability to encode/decode values to/from binary.
There are more general abstractions though, such as Encoder and Decoder. There's also GenCodec which extends both
Encoder
andDecoder
but allows the types to vary. Given these more general abstractions, aCodec[A]
can be represented as aGenCodec[A, A]
.The more general abstractions are important because they allow operations on codecs that would not otherwise be possible. For example, given a
Codec[A]
, mapping a functionA => B
over the codec yields aGenCodec[A, B]
. Without the more general abstractions,map
is impossible to define (e.g., how wouldcodec.map(f).encode(b)
be implemented?). Given aGenCodec[A, B]
, the encoding functionality can be ignored by treating it as aDecoder[B]
, or the encoding type can be changed viacontramap
. If after further transformations, the two types toGenCodec
are equal, we can reconstitute aCodec
from theGenCodec
by callingfuse
.See the codecs package object for pre-defined codecs for many common data types and combinators for building larger codecs out of smaller ones.
For the categorically minded, note the following:
Decoder
is a monadEncoder
is a contravariant functorGenCodec
is a profunctorCodec
is an invariant functor