T
- component type of this functorpublic interface Functor<T>
Defines a Functor by generalizing the map.
All instances of the Functor interface should obey the two functor laws:m.map(a -> a) ≡ m
m.map(f.compose(g)) ≡ m.map(g).map(f)
Modifier and Type | Method and Description |
---|---|
<U> Functor<U> |
map(java.util.function.Function<? super T,? extends U> mapper)
Applies a function f to the components of this Functor.
|
<U> Functor<U> map(java.util.function.Function<? super T,? extends U> mapper)
U
- type of the component of the resulting Functormapper
- a Function which maps the component of this FunctorNullPointerException
- if f
is nullCopyright © 2015. All Rights Reserved.