Uses of Class
com.jnape.palatable.lambda.adt.Try
Packages that use Try
-
Uses of Try in com.jnape.palatable.lambda.adt
Subclasses of Try in com.jnape.palatable.lambda.adtModifier and TypeClassDescriptionprivate static final class
Try.Failure<A>
private static final class
Try.Success<A>
Methods in com.jnape.palatable.lambda.adt with type parameters of type TryModifier and TypeMethodDescription<B,
App extends Applicative<?, App>, TravB extends Traversable<B, Try<?>>, AppTrav extends Applicative<TravB, App>>
AppTravTry.traverse
(Fn1<? super A, ? extends Applicative<B, App>> fn, Fn1<? super TravB, ? extends AppTrav> pure) Applyfn
to each element of this traversable from left to right, and collapse the results into a single resulting applicative, potentially with the assistance of the applicative's pure function.Methods in com.jnape.palatable.lambda.adt that return TryModifier and TypeMethodDescriptionTry.catching
(Fn1<? super Throwable, ? extends Boolean> predicate, Fn1<? super Throwable, ? extends A> recoveryFn) Catch any thrownT
satisfyingpredicate
and map it to a success value.Catch any instance ofthrowableType
and map it to a success value.<B> Try
<B> Try.discardL
(Applicative<B, Try<?>> appB) Sequence both thisApplicative
andappB
, discarding thisApplicative's
result and returningappB
.Try.discardR
(Applicative<B, Try<?>> appB) Sequence both thisApplicative
andappB
, discardingappB's
result and returning thisApplicative
.Try.ensuring
(SideEffect sideEffect) Run the provided runnable regardless of whether this is a success or a failure (theTry
analog tofinally
.static <A> Try
<A> Static factory method for creating a failure value.<B> Try
<B> Chain dependent computations that may continue or short-circuit based on previous results.<B> Try
<B> Covariantly transmute this functor's parameter using the given mapping function.<B> Try
<B> Try.pure
(B b) Lift the valueb
into this applicative functor.static <A> Try
<A> Try.success
(A a) Static factory method for creating a success value.Try.throwError
(Throwable throwable) Throw an error value of typeE
into themonad
.<B> Try
<B> Try.trampolineM
(Fn1<? super A, ? extends MonadRec<RecursiveResult<A, B>, Try<?>>> fn) Given some operation yielding aRecursiveResult
inside thisMonadRec
, internally trampoline the operation until it yields atermination
instruction.static <A> Try
<A> Try.trying
(SideEffect sideEffect) static <A extends AutoCloseable,
B extends AutoCloseable, C extends AutoCloseable, D>
Try<D> Try.withResources
(Fn0<? extends A> fn0, Fn1<? super A, ? extends B> bFn, Fn1<? super B, ? extends C> cFn, Fn1<? super C, ? extends Try<? extends D>> fn) Convenience overload ofwithResources
that cascades two dependent resource creations via nested calls.static <A extends AutoCloseable,
B extends AutoCloseable, C>
Try<C> Try.withResources
(Fn0<? extends A> fn0, Fn1<? super A, ? extends B> bFn, Fn1<? super B, ? extends Try<? extends C>> fn) Convenience overload ofwithResources
that cascades dependent resource creation via nested calls.static <A extends AutoCloseable,
B>
Try<B> Try.withResources
(Fn0<? extends A> fn0, Fn1<? super A, ? extends Try<? extends B>> fn) Given aFn0
<AutoCloseable
>aSupplier
and anFn1
fn
, applyfn
to the result ofaSupplier
, ensuring that the result has itsclose
method invoked, regardless of the outcome.<B> Try
<B> Try.zip
(Applicative<Fn1<? super A, ? extends B>, Try<?>> appFn) Given another instance of this applicative over a mapping function, "zip" the two instances together using whatever application semantics the current applicative supports.Methods in com.jnape.palatable.lambda.adt that return types with arguments of type TryModifier and TypeMethodDescriptionGiven alazy
instance of this applicative over a mapping function, "zip" the two instances together using whatever application semantics the current applicative supports.Try.pureTry()
Method parameters in com.jnape.palatable.lambda.adt with type arguments of type TryModifier and TypeMethodDescription<B> Try
<B> Try.discardL
(Applicative<B, Try<?>> appB) Sequence both thisApplicative
andappB
, discarding thisApplicative's
result and returningappB
.Try.discardR
(Applicative<B, Try<?>> appB) Sequence both thisApplicative
andappB
, discardingappB's
result and returning thisApplicative
.<B> Try
<B> Chain dependent computations that may continue or short-circuit based on previous results.Given alazy
instance of this applicative over a mapping function, "zip" the two instances together using whatever application semantics the current applicative supports.<B> Try
<B> Try.trampolineM
(Fn1<? super A, ? extends MonadRec<RecursiveResult<A, B>, Try<?>>> fn) Given some operation yielding aRecursiveResult
inside thisMonadRec
, internally trampoline the operation until it yields atermination
instruction.static <A extends AutoCloseable,
B>
Try<B> Try.withResources
(Fn0<? extends A> fn0, Fn1<? super A, ? extends Try<? extends B>> fn) Given aFn0
<AutoCloseable
>aSupplier
and anFn1
fn
, applyfn
to the result ofaSupplier
, ensuring that the result has itsclose
method invoked, regardless of the outcome.<B> Try
<B> Try.zip
(Applicative<Fn1<? super A, ? extends B>, Try<?>> appFn) Given another instance of this applicative over a mapping function, "zip" the two instances together using whatever application semantics the current applicative supports.