Transforms using implicitly available evidence that such a transformation is possible.
Transforms using implicitly available evidence that such a transformation is possible.
Typical transformations include converting:
F[L]
for some L <: HList
to/from an F[CC]
for some case class CC
, where the types in the case class are
aligned with the types in L
F[C]
for some C <: Coproduct
to/from an F[SC]
for some sealed class SC
, where the component types in
the coproduct are the leaf subtypes of the sealed class.Gets this as an Encoder
.
Converts this encoder to a new encoder that compacts the generated bit vector before returning it
Converts this encoder to an Encoder[B]
using the supplied B => A
.
Converts this encoder to an Encoder[B]
using the supplied B => Err \/ A
.
Converts this to a codec that fails decoding with an error.
Encodes the specified value in to a bit vector, throwing an
IllegalArgumentException
if encoding fails.
Encodes the specified value in to a bit vector, throwing an
IllegalArgumentException
if encoding fails.
value to encode
upon encoding failure
Transforms using two functions, A => Err \/ B
and B => Err \/ A
.
Transforms using two functions, A => Err \/ B
and B => Err \/ A
.
Transforms using two functions, A => Err \/ B
and B => A
.
Transforms using two functions, A => Err \/ B
and B => A
.
The supplied functions form an injection from B
to A
. Hence, this method converts from
a larger to a smaller type. Hence, the name narrow
.
Converts this encoder to an Encoder[B]
using the supplied partial
function from B
to A
.
Converts this encoder to an Encoder[B]
using the supplied partial
function from B
to A
. The encoding will fail for any B
that
f
maps to None
.
Transforms using two functions, A => B
and B => Option[A]
.
Transforms using two functions, A => B
and B => Option[A]
.
Particularly useful when combined with case class apply/unapply. E.g., pxmap(fa, Foo.apply, Foo.unappy)
.
When called on a Encoder[C]
where C
is a coproduct containing type A
, converts to an Encoder[A]
.
When called on a Encoder[C]
where C
is a coproduct containing type A
, converts to an Encoder[A]
.
Transforms using two functions, A => B
and B => Err \/ A
.
Transforms using two functions, A => B
and B => Err \/ A
.
The supplied functions form an injection from A
to B
. Hence, this method converts from
a smaller to a larger type. Hence, the name widen
.
Transforms using the isomorphism described by two functions, A => B
and B => A
.
Transforms using the isomorphism described by two functions, A => B
and B => A
.
Supports encoding a value of type
A
to aBitVector
.