CRE - @FunctionalInterface
public interface Functor<CRE>
| Modifier and Type | Method and Description |
|---|---|
default <T,R> java.util.function.Function<Higher<CRE,T>,Higher<CRE,R>> |
lift(java.util.function.Function<? super T,? extends R> fn) |
default <T,R> Higher<CRE,R> |
map_(Higher<CRE,T> ds,
java.util.function.Function<? super T,? extends R> fn) |
<T,R> Higher<CRE,R> |
map(java.util.function.Function<? super T,? extends R> fn,
Higher<CRE,T> ds)
Transform the supplied data structure using the supplied transformation function
|
default <T> Higher<CRE,T> |
peek(java.util.function.Consumer<? super T> fn,
Higher<CRE,T> ds) |
<T,R> Higher<CRE,R> map(java.util.function.Function<? super T,? extends R> fn, Higher<CRE,T> ds)
ListX<Integer> listx = ListX.of(1,2,3);
ListType<Integer> mapped1 =Lists.functor().map(a->a+1, ListType.widen(listx));
mapped1.add(1);
ListX<Integer> listxMapped = mapped1.list();
fn - Transformation functionds - Datastructure to applyHKTdefault <T,R> Higher<CRE,R> map_(Higher<CRE,T> ds, java.util.function.Function<? super T,? extends R> fn)