A
- the initial value to map and clean upB
- the resulting typepublic final class Bracket<A,B> extends Object implements Fn3<IO<A>,Fn1<? super A,? extends IO<?>>,Fn1<? super A,? extends IO<B>>,IO<B>>
IO
that yields some type A
, a cleanup operation to run if a value of that type could be
provisioned, and a kleisli arrow from that type to a new IO
of type B
, produce an
IO
<B>
that, when run, will provision the A
,
flatMap
it to B
, and clean up the original value if it was produced in the
first place.Modifier and Type | Method and Description |
---|---|
static <A,B> Bracket<A,B> |
bracket() |
static <A,B> Fn2<Fn1<? super A,? extends IO<?>>,Fn1<? super A,? extends IO<B>>,IO<B>> |
bracket(IO<A> io) |
static <A,B> Fn1<Fn1<? super A,? extends IO<B>>,IO<B>> |
bracket(IO<A> io,
Fn1<? super A,? extends IO<?>> cleanupIO) |
static <A,B> IO<B> |
bracket(IO<A> io,
Fn1<? super A,? extends IO<?>> cleanupIO,
Fn1<? super A,? extends IO<B>> bodyIO) |
IO<B> |
checkedApply(IO<A> io,
Fn1<? super A,? extends IO<?>> cleanupIO,
Fn1<? super A,? extends IO<B>> bodyIO) |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
apply, apply, apply, checkedApply, compose, contraMap, diMapL, discardR, flip, fn3, fn3, fn3, uncurry, widen
checkedApply, curried, curry, fn2, fromBiFunction, toBiFunction
public IO<B> checkedApply(IO<A> io, Fn1<? super A,? extends IO<?>> cleanupIO, Fn1<? super A,? extends IO<B>> bodyIO) throws Throwable
public static <A,B> Bracket<A,B> bracket()
public static <A,B> Fn2<Fn1<? super A,? extends IO<?>>,Fn1<? super A,? extends IO<B>>,IO<B>> bracket(IO<A> io)
public static <A,B> Fn1<Fn1<? super A,? extends IO<B>>,IO<B>> bracket(IO<A> io, Fn1<? super A,? extends IO<?>> cleanupIO)