com.jnape.palatable.lambda.functions.builtin.fn3

## Class Bracket<A,B>

- java.lang.Object
- - com.jnape.palatable.lambda.functions.builtin.fn3.Bracket<A,B>

- Type Parameters:
    `A` - the initial value to map and clean up
    `B` - the resulting type
  All Implemented Interfaces:
    Fn1<IO<A>,Fn1<Fn1<? super A,? extends IO<?>>,Fn1<Fn1<? super A,? extends IO<B>>,IO<B>>>>, Fn2<IO<A>,Fn1<? super A,? extends IO<?>>,Fn1<Fn1<? super A,? extends IO<B>>,IO<B>>>, Fn3<IO<A>,Fn1<? super A,? extends IO<?>>,Fn1<? super A,? extends IO<B>>,IO<B>>, Applicative<Fn1<Fn1<? super A,? extends IO<?>>,Fn1<Fn1<? super A,? extends IO<B>>,IO<B>>>,Fn1<IO<A>,?>>, Cartesian<IO<A>,Fn1<Fn1<? super A,? extends IO<?>>,Fn1<Fn1<? super A,? extends IO<B>>,IO<B>>>,Fn1<?,?>>, Cocartesian<IO<A>,Fn1<Fn1<? super A,? extends IO<?>>,Fn1<Fn1<? super A,? extends IO<B>>,IO<B>>>,Fn1<?,?>>, Contravariant<IO<A>,Profunctor<?,Fn1<Fn1<? super A,? extends IO<?>>,Fn1<Fn1<? super A,? extends IO<B>>,IO<B>>>,Fn1<?,?>>>, Functor<Fn1<Fn1<? super A,? extends IO<?>>,Fn1<Fn1<? super A,? extends IO<B>>,IO<B>>>,Fn1<IO<A>,?>>, Profunctor<IO<A>,Fn1<Fn1<? super A,? extends IO<?>>,Fn1<Fn1<? super A,? extends IO<B>>,IO<B>>>,Fn1<?,?>>, Monad<Fn1<Fn1<? super A,? extends IO<?>>,Fn1<Fn1<? super A,? extends IO<B>>,IO<B>>>,Fn1<IO<A>,?>>, MonadReader<IO<A>,Fn1<Fn1<? super A,? extends IO<?>>,Fn1<Fn1<? super A,? extends IO<B>>,IO<B>>>,Fn1<IO<A>,?>>, MonadRec<Fn1<Fn1<? super A,? extends IO<?>>,Fn1<Fn1<? super A,? extends IO<B>>,IO<B>>>,Fn1<IO<A>,?>>, MonadWriter<IO<A>,Fn1<Fn1<? super A,? extends IO<?>>,Fn1<Fn1<? super A,? extends IO<B>>,IO<B>>>,Fn1<IO<A>,?>>

      public final class Bracket<A,B>
      extends Object
      implements Fn3<IO<A>,Fn1<? super A,? extends IO<?>>,Fn1<? super A,? extends IO<B>>,IO<B>>

  Given an `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.

- - ### Method Summary

    All Methods Static Methods Instance Methods Concrete Methods
    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)`

    - ### Methods inherited from class java.lang.Object

      `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

    - ### Methods inherited from interface com.jnape.palatable.lambda.functions.Fn3

      `apply, apply, apply, checkedApply, compose, contraMap, diMapL, discardR, flip, fn3, fn3, fn3, uncurry, widen`

    - ### Methods inherited from interface com.jnape.palatable.lambda.functions.Fn2

      `checkedApply, curried, curry, fn2, fromBiFunction, toBiFunction`

    - ### Methods inherited from interface com.jnape.palatable.lambda.functions.Fn1

      `andThen, carry, cartesian, censor, choose, cocartesian, diMap, diMapR, discardL, flatMap, fmap, fn1, fromFunction, lazyZip, listens, local, pure, pureFn1, thunk, toFunction, trampolineM, zip, zip`

    - ### Methods inherited from interface com.jnape.palatable.lambda.monad.Monad

      `join`

    - ### Methods inherited from interface com.jnape.palatable.lambda.functor.Functor

      `coerce`

- - ### Method Detail

    - #### checkedApply

          public IO<B> checkedApply(IO<A> io,
                                    Fn1<? super A,? extends IO<?>> cleanupIO,
                                    Fn1<? super A,? extends IO<B>> bodyIO)
                             throws Throwable

      Specified by:
        `checkedApply` in interface `Fn3<IO<A>,Fn1<? super A,? extends IO<?>>,Fn1<? super A,? extends IO<B>>,IO<B>>`
      Throws:
        `Throwable`

    - #### bracket

          public static <A,B> Bracket<A,B> bracket()

    - #### bracket

          public static <A,B> Fn2<Fn1<? super A,? extends IO<?>>,Fn1<? super A,? extends IO<B>>,IO<B>> bracket(IO<A> io)

    - #### bracket

          public static <A,B> Fn1<Fn1<? super A,? extends IO<B>>,IO<B>> bracket(IO<A> io,
                                                                                Fn1<? super A,? extends IO<?>> cleanupIO)

    - #### bracket

          public static <A,B> IO<B> bracket(IO<A> io,
                                            Fn1<? super A,? extends IO<?>> cleanupIO,
                                            Fn1<? super A,? extends IO<B>> bodyIO)