kotools / libraries

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

Variants of `toStrictlyPositiveInt` function #141

Closed LVMVRQUXL closed 1 year ago

LVMVRQUXL commented 1 year ago

Description

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

inline fun Int.toStrictlyPositiveIntOrElse(onFailure: (IllegalArgumentException) -> StrictlyPositiveInt): StrictlyPositiveInt = TODO()
fun Int.toStrictlyPositiveIntOrNull(): StrictlyPositiveInt? = TODO()
fun Int.toStrictlyPositiveIntOrThrow(): StrictlyPositiveInt = TODO()

Checklist