kotools / libraries

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

Variants of `toPositiveInt` function #139

Closed LVMVRQUXL closed 1 year ago

LVMVRQUXL commented 1 year ago

Description

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

inline fun Int.toPositiveIntOrElse(onFailure: (IllegalArgumentException) -> PositiveInt): PositiveInt = TODO()
fun Int.toPositiveIntOrNull(): PositiveInt? = TODO()
fun Int.toPositiveIntOrThrow(): PositiveInt = TODO()

Checklist