A
- The type of the parameterF
- The unification parameter@FunctionalInterface public interface Functor<A,F extends Functor<?,F>>
map
over some parameter A
.
Functors are foundational to many of the classes provided by this library; generally, anything that can be thought of
as "mappable" is an instance of at least this interface.
For more information, read about Functors.
Bifunctor
,
Profunctor
,
Fn1
,
Tuple2
,
Either
Modifier and Type | Method and Description |
---|---|
default <Concrete extends Functor<A,F>> |
coerce()
Convenience method for coercing this functor instance into another concrete type.
|
<B> Functor<B,F> |
fmap(Fn1<? super A,? extends B> fn)
Covariantly transmute this functor's parameter using the given mapping function.
|
<B> Functor<B,F> fmap(Fn1<? super A,? extends B> fn)
B
- the new parameter typefn
- the mapping function