public interface MonadicValue2<T1,T2> extends MonadicValue<T2>
Value.ValueImpl<T>
Convertable.SupplierToConvertable<T>
Modifier and Type | Method and Description |
---|---|
default MonadicValue2<T1,T2> |
combine(Monoid<T2> monoid,
MonadicValue2<? extends T1,? extends T2> v2)
Eagerly combine two MonadicValues using the supplied monoid
|
<R1,R2> MonadicValue2<R1,R2> |
flatMap(java.util.function.Function<? super T2,? extends MonadicValue2<? extends R1,? extends R2>> mapper) |
<R> MonadicValue2<T1,R> |
map(java.util.function.Function<? super T2,? extends R> fn)
Transform this functor using the supplied transformation function
|
<T2> MonadicValue2<T1,T2> |
unit(T2 unit) |
anyM, coflatMap, nest
collect, fold, fold, generate, iterate, mapReduce, mkString, newSubscriber, of, stream, subscribe, test, toDequeX, toEvalAlways, toEvalLater, toEvalNow, toFeatureToggle, toFutureStream, toFutureStream, toIor, toLazyImmutable, toList, toListX, toMaybe, toMutable, toPBagX, toPOrderedSetX, toPQueueX, toPSetX, toPStackX, toPVectorX, toQueueX, toSetX, toSimpleReact, toSimpleReact, toSortedSetX, toTry, toTry, toTry, toXor, toXor, unapply
endsWith, endsWithIterable, findAny, findFirst, firstValue, foldable, foldRight, foldRight, foldRight, foldRightMapToType, get, groupBy, join, join, join, mapReduce, print, print, printErr, printOut, reduce, reduce, reduce, reduce, reduce, reduce, reduce, schedule, scheduleFixedDelay, scheduleFixedRate, single, single, singleOptional, startsWith, startsWithIterable, toConcurrentLazyCollection, toConcurrentLazyStreamable, toLazyCollection, validate, xMatch
collect, fromSupplier, get, isPresent, iterator, orElse, orElseGet, orElseThrow, toAtomicReference, toCompletableFuture, toCompletableFutureAsync, toCompletableFutureAsync, toFutureW, toFutureWAsync, toFutureWAsync, toOptional, toOptionalAtomicReference, toStream, visit
cast, patternMatch, peek, trampoline
<R1,R2> MonadicValue2<R1,R2> flatMap(java.util.function.Function<? super T2,? extends MonadicValue2<? extends R1,? extends R2>> mapper)
default MonadicValue2<T1,T2> combine(Monoid<T2> monoid, MonadicValue2<? extends T1,? extends T2> v2)
Monoid<Integer> add = Mondoid.of(1,Semigroups.intSum);
Maybe.of(10).plus(add,Maybe.none());
//Maybe[10]
Maybe.none().plus(add,Maybe.of(10));
//Maybe[10]
Maybe.none().plus(add,Maybe.none());
//Maybe.none()
Maybe.of(10).plus(add,Maybe.of(10));
//Maybe[20]
Monoid<Integer> firstNonNull = Monoid.of(null , Semigroups.firstNonNull());
Maybe.of(10).plus(firstNonNull,Maybe.of(10));
//Maybe[10]
monoid
- v2
- <R> MonadicValue2<T1,R> map(java.util.function.Function<? super T2,? extends R> fn)
Functor
of(1,2,3).map(i->i*2)
//[2,4,6]
<T2> MonadicValue2<T1,T2> unit(T2 unit)