kotools / libraries

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

New hierarchy of integers #132

Closed LVMVRQUXL closed 1 year ago

LVMVRQUXL commented 1 year ago

Description

Introduce a new hierarchy of integers in the kotools.types.number package with the following types:

Code example

sealed interface AnyInt
sealed interface NonZeroInt : AnyInt
sealed interface PositiveInt : AnyInt
sealed interface NegativeInt : AnyInt
class StrictlyPositiveInt : NonZeroInt, PositiveInt
class StrictlyNegativeInt : NonZeroInt, NegativeInt
object ZeroInt : PositiveInt, NegativeInt

Checklist

LVMVRQUXL commented 1 year ago

Done.

LVMVRQUXL commented 1 year ago

Make the following types serializable:

Update the serialization of the following types: