jvmMain.arrow.AutoCloseableExtensions.kt Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of arrow-autoclose-jvm Show documentation
Show all versions of arrow-autoclose-jvm Show documentation
Functional companion to Kotlin's Standard Library
package arrow
public fun AutoCloseScope.install(autoCloseable: A): A =
autoClose({ autoCloseable }) { a, errorOrNull ->
a.close()
errorOrNull?.let { throw it }
}