Transform

trait Transform[F <: ([_$1] =>> Any)]
Typeclass that describes type constructors that support the exmap operation.
class Object
trait Matchable
class Any

Extensions

Extensions

extension (fa: F[A])
inline def xmapc[A, B](f: A => B)(g: B => A): F[B]
Curried version of xmap.
extension (fa: F[A])
def narrow[A, B](f: A => Attempt[B], g: B => A): F[B]
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.
extension (fa: F[A])
def widenOpt[A, B](f: A => B, g: B => Option[A]): F[B]
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).
extension (fa: F[A])
def xmap[A, B](f: A => B, g: B => A): F[B]
Transforms supplied F[A] to an F[B] using the isomorphism described by two functions,
A => B and B => A.
extension (fa: F[A])
def widen[A, B](f: A => B, g: B => Attempt[A]): F[B]
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.
extension (fa: F[A])
def exmap[A, B](f: A => Attempt[B], g: B => Attempt[A]): F[B]
Transforms supplied F[A] to an F[B] using two functions, A => Attempt[B] and B => Attempt[A].