public interface MonadicValue1<T> extends MonadicValue<T>
Value.ValueImpl<T>Convertable.SupplierToConvertable<T>| Modifier and Type | Method and Description |
|---|---|
default AnyMValue<T> |
anyM() |
default <R> MonadicValue<R> |
coflatMap(java.util.function.Function<? super MonadicValue<T>,R> mapper) |
default MonadicValue1<T> |
combine(Monoid<T> monoid,
MonadicValue<? extends T> v2)
Eagerly combine two MonadicValues using the supplied monoid (@see ApplicativeFunctor for type appropraite i.e.
|
<R> MonadicValue<R> |
flatMap(java.util.function.Function<? super T,? extends MonadicValue<? extends R>> mapper) |
<R> MonadicValue<R> |
map(java.util.function.Function<? super T,? extends R> fn)
Transform this functor using the supplied transformation function
|
<T> MonadicValue1<T> |
unit(T unit) |
nestcollect, 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, unapplyendsWith, 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, xMatchcollect, fromSupplier, get, isPresent, iterator, orElse, orElseGet, orElseThrow, toAtomicReference, toCompletableFuture, toCompletableFutureAsync, toCompletableFutureAsync, toFutureW, toFutureWAsync, toFutureWAsync, toOptional, toOptionalAtomicReference, toStream, visitcast, patternMatch, peek, trampoline<T> MonadicValue1<T> unit(T unit)
<R> MonadicValue<R> map(java.util.function.Function<? super T,? extends R> fn)
Functor
of(1,2,3).map(i->i*2)
//[2,4,6]
default AnyMValue<T> anyM()
anyM in interface MonadicValue<T>default <R> MonadicValue<R> coflatMap(java.util.function.Function<? super MonadicValue<T>,R> mapper)
coflatMap in interface MonadicValue<T>default MonadicValue1<T> combine(Monoid<T> monoid, MonadicValue<? extends T> v2)
Monoid<Integer> add = Monoid.of(1,Semigroups.intSum);
Maybe.of(10).combine(add,Maybe.none());
//Maybe[10]
Maybe.none().combine(add,Maybe.of(10));
//Maybe[10]
Maybe.none().combine(add,Maybe.none());
//Maybe.none()
Maybe.of(10).combine(add,Maybe.of(10));
//Maybe[20]
Monoid<Integer> firstNonNull = Monoid.of(null , Semigroups.firstNonNull());
Maybe.of(10).combine(firstNonNull,Maybe.of(10));
//Maybe[10]
monoid - v2 - <R> MonadicValue<R> flatMap(java.util.function.Function<? super T,? extends MonadicValue<? extends R>> mapper)