T1
- Core typeT2
- Data type of elements in Core Typepublic interface Higher<T1,T2> extends Convert<Higher<T1,T2>>
Modifier and Type | Method and Description |
---|---|
default <T3,R> Higher<T1,R> |
apply_(java.util.function.BiFunction<? super T3,? super Higher<T1,T2>,? extends Higher<T1,R>> biFn,
T3 param)
Apply the provided BiFunction passing this as the second parameter
This allows a fluent api without narrowing or unwrapping simulated Higher Kinded Types
|
default <T3,R> Higher<T1,R> |
apply(T3 param,
java.util.function.BiFunction<? super Higher<T1,T2>,? super T3,? extends Higher<T1,R>> biFn)
Apply the provided BiFunction passing this as the first parameter
This allows a fluent api without narrowing or unwrapping simulated Higher Kinded Types
|
default <R> Higher<T1,R> |
transform(java.util.function.Function<? super Higher<T1,T2>,? extends Higher<T1,R>> fn) |
default <T3,R> Higher<T1,R> apply_(java.util.function.BiFunction<? super T3,? super Higher<T1,T2>,? extends Higher<T1,R>> biFn, T3 param)
Functor<ListType.µ> f = TypeClasses.General
.<ListType.µ,List<?>>functor(ListType::narrow,(list,fn)->ListX.fromIterable(list).map(fn));
List<Integer> mapped2 = f.map(a->a+1, ListType.widen(Arrays.asList(1,2,3)))
.then_(f::map,λ(this::mult3))
.then_(f::map,λ(this::add2))
.convert(ListType::narrow);
biFn
- BiFunction to executeparam
- 1st parameter to pass to BiFunctiondefault <R> Higher<T1,R> transform(java.util.function.Function<? super Higher<T1,T2>,? extends Higher<T1,R>> fn)
default <T3,R> Higher<T1,R> apply(T3 param, java.util.function.BiFunction<? super Higher<T1,T2>,? super T3,? extends Higher<T1,R>> biFn)
biFn
- BiFunction to executeparam
- 2nd parameter to pass to BiFunction