arrow-fx / arrow.fx.extensions.io.bracket / arrow.Kind / guaranteeCase

guaranteeCase

@JvmName("guaranteeCase") fun <A> Kind<ForIO, A>.~~guaranteeCase~~(finalizer: (ExitCase<Throwable>) -> Kind<ForIO, Unit>): IO<A> Deprecated: The IO datatype and it’s related type classes will disappear in Arrow 0.13.0. All useful operations are offered directly over suspend functions by Arrow Fx Coroutines. https://arrow-kt.io/docs/fx/async/

Executes the given finalizer when the source is finished, either in success or in error, or if cancelled, allowing for differentiating between exit conditions. That’s thanks to the ExitCase argument of the finalizer.

As best practice, it’s not a good idea to release resources via guaranteeCase in polymorphic code. Prefer bracketCase for the acquisition and release of resources.

See Also

guarantee

bracketCase

Do you like Arrow?

Arrow Org
<