A
- the result type@FunctionalInterface public interface Fn0<A> extends Fn1<Unit,A>
Modifier and Type | Method and Description |
---|---|
default A |
apply()
|
A |
checkedApply() |
default A |
checkedApply(Unit unit)
Invoke this function with the given argument, potentially throwing any
Throwable . |
default <B> Fn0<B> |
diMapR(Fn1<? super A,? extends B> fn)
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 this
Applicative and appB , discarding this Applicative's
result and returning appB . |
default <B> Fn0<A> |
discardR(Applicative<B,Fn1<Unit,?>> appB)
Sequence both this
Applicative and appB , discarding appB's result and
returning this Applicative . |
default <B> Fn0<B> |
flatMap(Fn1<? super A,? extends Monad<B,Fn1<Unit,?>>> f)
Chain dependent computations that may continue or short-circuit based on previous results.
|
default <B> Fn0<B> |
fmap(Fn1<? super A,? extends B> f)
Also left-to-right composition (sadly).
|
static <A> Fn0<A> |
fn0(Fn0<A> fn)
Static factory method for coercing a lambda to an
Fn0 . |
static <A> Fn0<A> |
fn0(Fn1<Unit,A> fn)
|
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 value
b into this applicative functor. |
default Callable<A> |
toCallable()
|
default Supplier<A> |
toSupplier()
|
default <B> Fn0<B> |
zip(Applicative<Fn1<? super A,? extends B>,Fn1<Unit,?>> appFn)
Given another instance of this applicative over a mapping function, "zip" the two instances together using
whatever application semantics the current applicative supports.
|
default <B> Fn0<B> |
zip(Fn2<Unit,A,B> appFn) |
default A apply()
default A checkedApply(Unit unit) throws Throwable
Throwable
.checkedApply
in interface Fn1<Unit,A>
unit
- the argumentThrowable
- anything possibly thrown by the functiondefault <B> Fn0<B> flatMap(Fn1<? super A,? extends Monad<B,Fn1<Unit,?>>> f)
Fn1
flatMap
in interface Fn1<Unit,A>
flatMap
in interface Monad<A,Fn1<Unit,?>>
flatMap
in interface MonadReader<Unit,A,Fn1<Unit,?>>
flatMap
in interface MonadRec<A,Fn1<Unit,?>>
flatMap
in interface MonadWriter<Unit,A,Fn1<Unit,?>>
B
- the resulting monad parameter typef
- the dependent computation over Adefault <B> Fn0<B> fmap(Fn1<? super A,? extends B> f)
Fn1
fmap
in interface Applicative<A,Fn1<Unit,?>>
fmap
in interface Fn1<Unit,A>
fmap
in interface Functor<A,Fn1<Unit,?>>
fmap
in interface Monad<A,Fn1<Unit,?>>
fmap
in interface MonadReader<Unit,A,Fn1<Unit,?>>
fmap
in interface MonadRec<A,Fn1<Unit,?>>
fmap
in interface MonadWriter<Unit,A,Fn1<Unit,?>>
B
- the return type of the next function to invokef
- the function to invoke with this function's return valuedefault <B> Fn0<B> pure(B b)
Fn1
b
into this applicative functor.pure
in interface Applicative<A,Fn1<Unit,?>>
pure
in interface Fn1<Unit,A>
pure
in interface Monad<A,Fn1<Unit,?>>
pure
in interface MonadReader<Unit,A,Fn1<Unit,?>>
pure
in interface MonadRec<A,Fn1<Unit,?>>
pure
in interface MonadWriter<Unit,A,Fn1<Unit,?>>
B
- the type of the returned applicative's parameterb
- the valuedefault <B> Fn0<B> zip(Applicative<Fn1<? super A,? extends B>,Fn1<Unit,?>> appFn)
Fn1
zip
in interface Applicative<A,Fn1<Unit,?>>
zip
in interface Fn1<Unit,A>
zip
in interface Monad<A,Fn1<Unit,?>>
zip
in interface MonadReader<Unit,A,Fn1<Unit,?>>
zip
in interface MonadRec<A,Fn1<Unit,?>>
zip
in interface MonadWriter<Unit,A,Fn1<Unit,?>>
B
- the resulting applicative parameter typeappFn
- the other applicative instancedefault <B> Fn0<B> discardL(Applicative<B,Fn1<Unit,?>> appB)
Fn1
Applicative
and appB
, discarding this Applicative's
result and returning appB
. This is generally useful for sequentially performing side-effects.discardL
in interface Applicative<A,Fn1<Unit,?>>
discardL
in interface Fn1<Unit,A>
discardL
in interface Monad<A,Fn1<Unit,?>>
discardL
in interface MonadReader<Unit,A,Fn1<Unit,?>>
discardL
in interface MonadRec<A,Fn1<Unit,?>>
discardL
in interface MonadWriter<Unit,A,Fn1<Unit,?>>
B
- the type of the returned Applicative's parameterappB
- the other Applicativedefault <B> Fn0<A> discardR(Applicative<B,Fn1<Unit,?>> appB)
Fn1
Applicative
and appB
, discarding appB's
result and
returning this Applicative
. This is generally useful for sequentially performing side-effects.discardR
in interface Applicative<A,Fn1<Unit,?>>
discardR
in interface Fn1<Unit,A>
discardR
in interface Monad<A,Fn1<Unit,?>>
discardR
in interface MonadReader<Unit,A,Fn1<Unit,?>>
discardR
in interface MonadRec<A,Fn1<Unit,?>>
discardR
in interface MonadWriter<Unit,A,Fn1<Unit,?>>
B
- the type of appB's parameterappB
- the other Applicativedefault <B> Fn0<B> diMapR(Fn1<? super A,? extends B> fn)
Fn1
diMapR
in interface Cartesian<Unit,A,Fn1<?,?>>
diMapR
in interface Cocartesian<Unit,A,Fn1<?,?>>
diMapR
in interface Fn1<Unit,A>
diMapR
in interface Profunctor<Unit,A,Fn1<?,?>>
B
- the new result typefn
- the covariant result mapping functionFn1
<A, C>static <A> Fn0<A> fromSupplier(Supplier<A> supplier)
A
- the output typesupplier
- the supplierFn0
static <A> Fn0<A> fromCallable(Callable<A> callable)
A
- the output typecallable
- the callableFn0
static <A> Fn0<A> fn0(Fn0<A> fn)
Fn0
.A
- the output typefn
- the lambda to coerceFn0