Interface IO<T>
- All Superinterfaces:
Applicable<IO<?>,,T> Bindable<IO<?>,,T> Effect<IO<?>,,T> IOOf<T>,Kind<IO<?>,,T> Mappable<IO<?>,,T> Recoverable
- All Known Implementing Classes:
IO.Async,IO.Delay,IO.Failure,IO.FlatMapped,IO.Pure,IO.Recover,IO.Suspend
public sealed interface IO<T>
extends IOOf<T>, Effect<IO<?>,T>, Recoverable
permits IO.Pure<T>, IO.Failure<T>, IO.FlatMapped<T,R>, IO.Delay<T>, IO.Async<T>, IO.Suspend<T>, IO.Recover<T>
-
Nested Class Summary
Nested ClassesModifier and TypeInterfaceDescriptionstatic final classstatic final classstatic final classstatic final classstatic final classstatic final classstatic final classNested classes/interfaces inherited from interface com.github.tonivade.purefun.core.Applicable
Applicable.Map2<F extends Applicable<F,?>, A, B>, Applicable.Map3<F extends Applicable<F, ?>, A, B, C>, Applicable.Map4<F extends Applicable<F, ?>, A, B, C, D>, Applicable.Map5<F extends Applicable<F, ?>, A, B, C, D, E> -
Field Summary
Fields -
Method Summary
Modifier and TypeMethodDescriptiondefault <R> IO<R> default <R> IO<R> static <T> IO<T> attempt()static <T extends AutoCloseable,R>
IO<R> bracket(Kind<IO<?>, ? extends T> acquire, Function1<? super T, ? extends Kind<IO<?>, ? extends R>> use) static <T,R> IO <R> bracket(Kind<IO<?>, ? extends T> acquire, Function1<? super T, ? extends Kind<IO<?>, ? extends R>> use, Consumer1<? super T> release) static <T,R> IO <R> bracket(Kind<IO<?>, ? extends T> acquire, Function1<? super T, ? extends Kind<IO<?>, ? extends R>> use, Function1<? super T, ? extends Kind<IO<?>, Unit>> release) static <T> IO<T> static <T> IO<T> either()exec(CheckedRunnable task) private static <T> Promise<T> executeAsync(IO.Async<T> current, IOConnection connection, Promise<T> promise) default <R> IO<R> fork()forked()static <T> IO<T> fromCompletableFuture(CompletableFuture<? extends T> promise) static <T> IO<T> fromEither(Either<Throwable, ? extends T> task) static <T> IO<T> fromOption(Option<? extends T> task) static <T> IO<T> fromPromise(Promise<? extends T> promise) static <T> IO<T> liftEither(Function1<? super A, ? extends Either<Throwable, ? extends B>> function) liftOption(Function1<? super A, ? extends Option<? extends B>> function) default <R> IO<R> static <T> IO<T> never()static <A,B, C> IO <C> parMap2(Kind<IO<?>, ? extends A> fa, Kind<IO<?>, ? extends B> fb, Function2<? super A, ? super B, ? extends C> mapper) static <A,B, C> IO <C> parMap2(Executor executor, Kind<IO<?>, ? extends A> fa, Kind<IO<?>, ? extends B> fb, Function2<? super A, ? super B, ? extends C> mapper) static <T> IO<T> pure(T value) static <T> IO<T> raiseError(Throwable error) recoverWith(PartialFunction1<? super Throwable, ? extends Kind<IO<?>, ? extends T>> mapper) default <R> IO<R> default <R> IO<R> redeemWith(Function1<? super Throwable, ? extends Kind<IO<?>, ? extends R>> mapError, Function1<? super T, ? extends Kind<IO<?>, ? extends R>> mapper) repeat()repeat(int times) private static <T> IO<T> retry()retry(int maxRetries) private static <T> IO<T> runAsync()private static <T> Promise<T> runAsync(Kind<IO<?>, T> current, IOConnection connection) private static <T,U, V> Promise <T> default voidsafeRunAsync(Consumer1<? super Try<? extends T>> callback) default voidsafeRunAsync(Executor executor, Consumer1<? super Try<? extends T>> callback) static <T> IO<T> static <T> IO<T> timed()unit()default Tunwrap(Kind<IO<?>, T> current, CallStack<U> stack, Function1<Kind<IO<?>, ? extends T>, Kind<IO<?>, ? extends U>> next) Methods inherited from interface com.github.tonivade.purefun.core.Effect
zip, zipLeft, zipRight, zipWithMethods inherited from interface com.github.tonivade.purefun.core.Recoverable
sneakyThrow
-
Field Details
-
UNIT
-
-
Method Details
-
runAsync
-
runAsync
-
unsafeRunSync
-
safeRunSync
-
safeRunAsync
-
safeRunAsync
-
map
-
flatMap
-
andThen
-
ap
-
attempt
-
either
-
either
-
redeem
-
redeemWith
-
recover
-
recover
-
recoverWith
-
timed
-
fork
-
timeout
-
timeout
-
repeat
-
repeat
-
repeat
-
repeat
-
retry
-
retry
-
retry
-
retry
-
pure
-
race
-
race
-
racePair
-
raiseError
-
delay
-
suspend
-
lift
-
liftOption
-
liftTry
-
liftEither
-
fromOption
-
fromTry
-
fromEither
-
fromPromise
-
fromCompletableFuture
-
sleep
-
sleep
-
exec
-
task
-
never
-
forked
-
forked
-
async
-
cancellable
-
memoize
-
memoize
-
unit
-
bracket
-
bracket
-
bracket
-
sequence
-
traverse
-
traverse
-
parMap2
-
parMap2
-
tuple
-
tuple
-
runAsync
-
runAsync
-
unwrap
-
executeAsync
private static <T> Promise<T> executeAsync(IO.Async<T> current, IOConnection connection, Promise<T> promise) -
repeat
-
retry
-