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> |
combineEager(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) |
nest
collect, fold, fold, generate, iterate, iterator, 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, orElse, orElseGet, orElseThrow, toAtomicReference, toCompletableFuture, toCompletableFutureAsync, toCompletableFutureAsync, toFutureW, toFutureWAsync, toFutureWAsync, toOptional, toOptionalAtomicReference, toStream, visit
cast, 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> combineEager(Monoid<T> monoid, MonadicValue<? extends T> v2)
Monoid<Integer> add = Monoid.of(1,Semigroups.intSum);
Maybe.of(10).combineEager(add,Maybe.none());
//Maybe[10]
Maybe.none().combineEager(add,Maybe.of(10));
//Maybe[10]
Maybe.none().combineEager(add,Maybe.none());
//Maybe.none()
Maybe.of(10).combineEager(add,Maybe.of(10));
//Maybe[20]
Monoid<Integer> firstNonNull = Monoid.of(null , Semigroups.firstNonNull());
Maybe.of(10).combineEager(firstNonNull,Maybe.of(10));
//Maybe[10]
monoid
- v2
- <R> MonadicValue<R> flatMap(java.util.function.Function<? super T,? extends MonadicValue<? extends R>> mapper)