Replaces the A
value in F[A]
with the supplied value.
Tuple the values in fa with the result of applying a function with the value
Lift a function f to operate on Functors
Tuples the A
value in F[A]
with the supplied B
value, with the B
value on the left.
Tuples the A
value in F[A]
with the supplied B
value, with the B
value on the right.
Empty the fa of the values, preserving the structure
Lifts natural subtyping covariance of covariant Functors.
Lifts natural subtyping covariance of covariant Functors.
NOTE: In certain (perhaps contrived) situations that rely on universal
equality this can result in a ClassCastException
, because it is
implemented as a type cast. It could be implemented as map(identity)
, but
according to the functor laws, that should be equal to fa
, and a type
cast is often much more performant.
See this example
of widen
creating a ClassCastException
.
Functor.
The name is short for "covariant functor".
Must obey the laws defined in cats.laws.FunctorLaws.