Transforms supplied F[A]
to an F[B]
using implicitly available evidence that such a transformation
is possible.
Transforms supplied F[A]
to an F[B]
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 supplied F[A]
to an F[B]
using two functions, A => Attempt[B]
and B => A
.
Transforms supplied F[A]
to an F[B]
using two functions, A => Attempt[B]
and B => A
.
The supplied functions form an injection from B
to A
. Hence, converting a F[A]
to a F[B]
converts from
a larger to a smaller type. Hence, the name narrow
.
Transforms supplied F[A]
to an F[B]
using two functions, A => B
and B => Attempt[A]
.
Transforms supplied F[A]
to an F[B]
using two functions, A => B
and B => Attempt[A]
.
The supplied functions form an injection from A
to B
. Hence, converting a F[A]
to a F[B]
converts from
a smaller to a larger type. Hence, the name widen
.
Transforms supplied F[A]
to an F[B]
using two functions, A => B
and B => Option[A]
.
Transforms supplied F[A]
to an F[B]
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)
.
Transforms supplied F[A]
to an F[B]
using the isomorphism described by two functions,
A => B
and B => A
.
Transforms supplied F[A]
to an F[B]
using two functions, A => B
and B => Option[A]
.
Transforms supplied F[A]
to an F[B]
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
Typeclass that describes type constructors that support the
exmap
operation.