Interface Fn0<A>
- Type Parameters:
A- the result type
- All Superinterfaces:
Applicative<A, Fn1<Unit,?>>, Cartesian<Unit, A, Fn1<?, ?>>, Cocartesian<Unit, A, Fn1<?, ?>>, Contravariant<Unit, Profunctor<?, A, Fn1<?, ?>>>, Fn1<Unit, A>, Functor<A, Fn1<Unit, ?>>, Monad<A, Fn1<Unit, ?>>, MonadReader<Unit, A, Fn1<Unit, ?>>, MonadRec<A, Fn1<Unit, ?>>, MonadWriter<Unit, A, Fn1<Unit, ?>>, Profunctor<Unit, A, Fn1<?, ?>>
- Functional Interface:
- This is a functional interface and can therefore be used as the assignment target for a lambda expression or method reference.
- See Also:
-
Method Summary
Modifier and TypeMethodDescriptiondefault Aapply()default AcheckedApply(Unit unit) Invoke this function with the given argument, potentially throwing anyThrowable.default <B> Fn0<B> Covariantly map over the return value of this function, producing a function that takes the same argument, and produces the new result type.default <B> Fn0<B> discardL(Applicative<B, Fn1<Unit, ?>> appB) Sequence both thisApplicativeandappB, discarding thisApplicative'sresult and returningappB.discardR(Applicative<B, Fn1<Unit, ?>> appB) Sequence both thisApplicativeandappB, discardingappB'sresult and returning thisApplicative.default <B> Fn0<B> Chain dependent computations that may continue or short-circuit based on previous results.default <B> Fn0<B> Left-to-right composition.static <A> Fn0<A> Static factory method for coercing a lambda to anFn0.static <A> Fn0<A> static <A> Fn0<A> fromCallable(Callable<A> callable) static <A> Fn0<A> fromSupplier(Supplier<A> supplier) default <B> Fn0<B> pure(B b) Lift the valuebinto this applicative functor.default <B> Fn0<B> default <B> Fn0<B> Given another instance of this applicative over a mapping function, "zip" the two instances together using whatever application semantics the current applicative supports.
-
Method Details
-
checkedApply
-
apply
-
toSupplier
-
toCallable
-
checkedApply
-
flatMap
Description copied from interface:Fn1Chain dependent computations that may continue or short-circuit based on previous results.- Specified by:
flatMapin interfaceFn1<Unit,A> - Specified by:
flatMapin interfaceMonad<A, Fn1<Unit,?>> - Specified by:
flatMapin interfaceMonadReader<Unit, A, Fn1<Unit,?>> - Specified by:
flatMapin interfaceMonadRec<A, Fn1<Unit,?>> - Specified by:
flatMapin interfaceMonadWriter<Unit, A, Fn1<Unit,?>> - Type Parameters:
B- the resulting monad parameter type- Parameters:
f- the dependent computation over A- Returns:
- the new monad instance
-
fmap
Description copied from interface:Fn1Left-to-right composition.- Specified by:
fmapin interfaceApplicative<A, Fn1<Unit,?>> - Specified by:
fmapin interfaceFn1<Unit,A> - Specified by:
fmapin interfaceFunctor<A, Fn1<Unit,?>> - Specified by:
fmapin interfaceMonad<A, Fn1<Unit,?>> - Specified by:
fmapin interfaceMonadReader<Unit, A, Fn1<Unit,?>> - Specified by:
fmapin interfaceMonadRec<A, Fn1<Unit,?>> - Specified by:
fmapin interfaceMonadWriter<Unit, A, Fn1<Unit,?>> - Type Parameters:
B- the return type of the next function to invoke- Parameters:
f- the function to invoke with this function's return value- Returns:
- a function representing the composition of this function and f
-
pure
Description copied from interface:Fn1Lift the valuebinto this applicative functor.- Specified by:
purein interfaceApplicative<A, Fn1<Unit,?>> - Specified by:
purein interfaceFn1<Unit,A> - Specified by:
purein interfaceMonad<A, Fn1<Unit,?>> - Specified by:
purein interfaceMonadReader<Unit, A, Fn1<Unit,?>> - Specified by:
purein interfaceMonadRec<A, Fn1<Unit,?>> - Specified by:
purein interfaceMonadWriter<Unit, A, Fn1<Unit,?>> - Type Parameters:
B- the type of the returned applicative's parameter- Parameters:
b- the value- Returns:
- an instance of this applicative over b
-
zip
Description copied from interface:Fn1Given another instance of this applicative over a mapping function, "zip" the two instances together using whatever application semantics the current applicative supports.- Specified by:
zipin interfaceApplicative<A, Fn1<Unit,?>> - Specified by:
zipin interfaceFn1<Unit,A> - Specified by:
zipin interfaceMonad<A, Fn1<Unit,?>> - Specified by:
zipin interfaceMonadReader<Unit, A, Fn1<Unit,?>> - Specified by:
zipin interfaceMonadRec<A, Fn1<Unit,?>> - Specified by:
zipin interfaceMonadWriter<Unit, A, Fn1<Unit,?>> - Type Parameters:
B- the resulting applicative parameter type- Parameters:
appFn- the other applicative instance- Returns:
- the mapped applicative
-
zip
-
discardL
Description copied from interface:Fn1Sequence both thisApplicativeandappB, discarding thisApplicative'sresult and returningappB. This is generally useful for sequentially performing side-effects.- Specified by:
discardLin interfaceApplicative<A, Fn1<Unit,?>> - Specified by:
discardLin interfaceFn1<Unit,A> - Specified by:
discardLin interfaceMonad<A, Fn1<Unit,?>> - Specified by:
discardLin interfaceMonadReader<Unit, A, Fn1<Unit,?>> - Specified by:
discardLin interfaceMonadRec<A, Fn1<Unit,?>> - Specified by:
discardLin interfaceMonadWriter<Unit, A, Fn1<Unit,?>> - Type Parameters:
B- the type of the returned Applicative's parameter- Parameters:
appB- the other Applicative- Returns:
- appB
-
discardR
Description copied from interface:Fn1Sequence both thisApplicativeandappB, discardingappB'sresult and returning thisApplicative. This is generally useful for sequentially performing side-effects.- Specified by:
discardRin interfaceApplicative<A, Fn1<Unit,?>> - Specified by:
discardRin interfaceFn1<Unit,A> - Specified by:
discardRin interfaceMonad<A, Fn1<Unit,?>> - Specified by:
discardRin interfaceMonadReader<Unit, A, Fn1<Unit,?>> - Specified by:
discardRin interfaceMonadRec<A, Fn1<Unit,?>> - Specified by:
discardRin interfaceMonadWriter<Unit, A, Fn1<Unit,?>> - Type Parameters:
B- the type of appB's parameter- Parameters:
appB- the other Applicative- Returns:
- this Applicative
-
diMapR
Description copied from interface:Fn1Covariantly map over the return value of this function, producing a function that takes the same argument, and produces the new result type.- Specified by:
diMapRin interfaceCartesian<Unit,A, Fn1<?, ?>> - Specified by:
diMapRin interfaceCocartesian<Unit,A, Fn1<?, ?>> - Specified by:
diMapRin interfaceFn1<Unit,A> - Specified by:
diMapRin interfaceProfunctor<Unit,A, Fn1<?, ?>> - Type Parameters:
B- the new result type- Parameters:
fn- the covariant result mapping function- Returns:
- an
Fn1<A, C>
-
fromSupplier
-
fromCallable
-
fn0
-
fn0
-