A
- the argument type@FunctionalInterface public interface Effect<A> extends Fn1<A,IO<Unit>>
Fn0
Modifier and Type | Method and Description |
---|---|
default Effect<A> |
andThen(Effect<A> effect)
Left-to-right composition of
Effects . |
default IO<Unit> |
apply(A a)
Invoke this function explosively with the given argument.
|
IO<Unit> |
checkedApply(A a)
Invoke this function with the given argument, potentially throwing any
Throwable . |
default <Z> Effect<Z> |
contraMap(Fn1<? super Z,? extends A> fn)
Contravariantly map
A <- B . |
default <Z> Effect<Z> |
diMapL(Fn1<? super Z,? extends A> fn)
Contravariantly map over the argument to this function, producing a function that takes the new argument type,
and produces the same result.
|
default <C> Effect<A> |
discardR(Applicative<C,Fn1<A,?>> appB)
Sequence both this
Applicative and appB , discarding appB's result and
returning this Applicative . |
static <A> Effect<A> |
effect(Fn1<? super A,? extends IO<?>> fn)
|
static <A> Effect<A> |
effect(SideEffect sideEffect)
Create an
Effect from a SideEffect ; |
static <A> Effect<A> |
fromConsumer(Consumer<A> consumer)
|
static <A> Effect<A> |
noop()
Create an
Effect that accepts an input and does nothing; |
default Consumer<A> |
toConsumer()
|
IO<Unit> checkedApply(A a) throws Throwable
Fn1
Throwable
.default <Z> Effect<Z> diMapL(Fn1<? super Z,? extends A> fn)
diMapL
in interface Cartesian<A,IO<Unit>,Fn1<?,?>>
diMapL
in interface Cocartesian<A,IO<Unit>,Fn1<?,?>>
diMapL
in interface Fn1<A,IO<Unit>>
diMapL
in interface Profunctor<A,IO<Unit>,Fn1<?,?>>
Z
- the new argument typefn
- the contravariant argument mapping functionFn1
<Z, B>default <Z> Effect<Z> contraMap(Fn1<? super Z,? extends A> fn)
A <- B
.contraMap
in interface Cartesian<A,IO<Unit>,Fn1<?,?>>
contraMap
in interface Cocartesian<A,IO<Unit>,Fn1<?,?>>
contraMap
in interface Contravariant<A,Profunctor<?,IO<Unit>,Fn1<?,?>>>
contraMap
in interface Fn1<A,IO<Unit>>
contraMap
in interface Profunctor<A,IO<Unit>,Fn1<?,?>>
Z
- the new parameter typefn
- the mapping functiondefault <C> Effect<A> discardR(Applicative<C,Fn1<A,?>> appB)
Applicative
and appB
, discarding appB's
result and
returning this Applicative
. This is generally useful for sequentially performing side-effects.discardR
in interface Applicative<IO<Unit>,Fn1<A,?>>
discardR
in interface Fn1<A,IO<Unit>>
discardR
in interface Monad<IO<Unit>,Fn1<A,?>>
discardR
in interface MonadReader<A,IO<Unit>,Fn1<A,?>>
discardR
in interface MonadRec<IO<Unit>,Fn1<A,?>>
discardR
in interface MonadWriter<A,IO<Unit>,Fn1<A,?>>
C
- the type of appB's parameterappB
- the other Applicativestatic <A> Effect<A> effect(SideEffect sideEffect)
Effect
from a SideEffect
;A
- any desired input typesideEffect
- the SideEffect
Effect
static <A> Effect<A> noop()
Effect
that accepts an input and does nothing;A
- any desired input typeEffect