kotools / libraries

Multiplatform libraries for expressive programming with Kotlin.
https://kotools.github.io/libraries
MIT License
0 stars 0 forks source link

Variants of `toNonZeroInt` function #131

Closed LVMVRQUXL closed 1 year ago

LVMVRQUXL commented 1 year ago

Description

Implement the following operations for improving the creation of a NonZeroInt type:

inline fun Int.toNonZeroIntOrElse(onFailure: (IllegalArgumentException) -> NonZeroInt): NonZeroInt = TODO()
fun Int.toNonZeroIntOrNull(): NonZeroInt? = TODO()
fun Int.toNonZeroIntOrThrow(): NonZeroInt = TODO()

Checklist