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.Transforms using two functions, A => Attempt[B]
and B => Attempt[A]
.
Transforms using two functions, A => Attempt[B]
and B => Attempt[A]
.
Curried version of exmap
.
Curried version of exmap
.
Transforms using two functions, A => Attempt[B]
and B => A
.
Transforms using two functions, A => Attempt[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
.
Curried version of narrow
.
Curried version of narrow
.
Supports TransformSyntax.
Supports TransformSyntax.
Transforms using two functions, A => B
and B => Attempt[A]
.
Transforms using two functions, A => B
and B => Attempt[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 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., widenOpt(fa, Foo.apply, Foo.unapply)
.
Curried version of widenOpt
.
Curried version of widenOpt
.
Curried version of widen
.
Curried version of 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
.
Curried version of xmap
.
Curried version of xmap
.
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.unapply)
.
(Since version 1.7.0) Use widenOpt instead
Supports creation of a DiscriminatorCodec. See discriminated for details.