Sign in

    nat

    Type-level natural number literals

    Download zip
    Version
    0.1.0
    License
    Apache-2.0
    Last updated
    10 months ago
    Downloads
    4K

    No dependencies

    #tonyfettes/nat

    A MoonBit library for type-level natural number literals.

    #Overview

    This library provides a way to represent natural numbers at the type level in MoonBit. While the numeric values are computed at runtime, the type-level encoding allows the type system to track and verify numeric constraints at compile time. It supports both decimal and hexadecimal number systems.

    #Features

    • Type-level natural numbers: Encode natural numbers directly in the type system
    • Decimal literals: Use types like Od1, Od2, etc. to represent decimal digits (0-9)
    • Hexadecimal literals: Use types like Ox1, OxA, etc. to represent hexadecimal digits (0-F)
    • Runtime conversion: Convert type-level numbers to runtime Int or UInt64 values
    • Static type checking: Ensure numeric constraints are verified at compile time

    #Use Cases

    Type-level natural numbers are particularly useful for:

    • Multi-dimensional arrays with statically known sizes: Encode array dimensions in the type system to prevent dimension mismatches at compile time
    • C FFI (Foreign Function Interface): Represent fixed-size buffers, array dimensions, or other numeric constants required by C APIs in a type-safe manner
    • Compile-time constraints: Any scenario where you need to enforce numeric constraints through the type system

    #Usage

    #Basic Usage

    // Convert a type-level number to UInt64
    let value = to_uint64((_ : Od42[Z]) => ()) // Returns 42 as UInt64

    // Convert to Int
    let int_value = to_int((_ : Od42[Z]) => ()) // Returns 42 as Int

    #Decimal Numbers

    Decimal digits are represented using types Od0 through Od9:

    to_uint64((_ : Od5[Z]) => ()) // 5
    to_uint64((_ : Od3[Od21[Z]]) => ()) // 321
    to_uint64((_ : Od12[Od34[Od56[Z]]]) => ()) // 123456

    The digits are composed right-to-left, with Z representing zero at the base.

    #Hexadecimal Numbers

    Hexadecimal digits are represented using types Ox0 through OxF:

    to_uint64((_ : OxA[Z]) => ()) // 10
    to_uint64((_ : OxF[Z]) => ()) // 15
    to_uint64((_ : Ox12[Ox34[Ox56[Z]]]) => ()) // 0x123456

    #Multi-digit Numbers

    You can compose larger numbers by nesting digit types. Pre-defined convenience types are available for common two-digit combinations:

    // Using convenience types
    to_uint64((_ : Od12[Z]) => ()) // 12
    to_uint64((_ : Od99[Z]) => ()) // 99

    // Using nested types
    to_uint64((_ : Od2[Od10[Z]]) => ()) // 210

    #Installation

    Add this to your moon.mod.json dependencies:

    moon update moon add tonyfettes/nat

    #API

    #Types

    • Z: Represents zero at the base of a number
    • Od0[T] through Od9[T]: Decimal digit types
    • Ox0[T] through OxF[T]: Hexadecimal digit types
    • Pre-defined convenience types for two-digit combinations (e.g., Od10, Od42, Ox1A)

    #Functions

    pub fn[T : ToUInt64] to_uint64(_ : (T) -> Unit) -> UInt64
    pub fn[T : ToInt] to_int(_ : (T) -> Unit) -> Int

    Convert a type-level number to a runtime value.

    #How It Works

    The library uses MoonBit's trait system to encode numbers at the type level. Each digit type implements the ToUInt64 and ToInt traits, which recursively compute the numeric value at runtime by multiplying the accumulated value by the base (10 for decimal, 16 for hexadecimal) and adding the digit. While the computation happens at runtime, the type-level encoding allows the compiler to verify numeric constraints and dimensions at compile time.

    #License

    Apache-2.0

    #Contributing

    Contributions are welcome! Please feel free to submit issues or pull requests.

    Od00

    type Od00[T] = Od0[Od0[T]]

    Od01

    type Od01[T] = Od0[Od1[T]]

    Od02

    type Od02[T] = Od0[Od2[T]]

    Od03

    type Od03[T] = Od0[Od3[T]]

    Od04

    type Od04[T] = Od0[Od4[T]]

    Od05

    type Od05[T] = Od0[Od5[T]]

    Od06

    type Od06[T] = Od0[Od6[T]]

    Od07

    type Od07[T] = Od0[Od7[T]]

    Od08

    type Od08[T] = Od0[Od8[T]]

    Od09

    type Od09[T] = Od0[Od9[T]]

    Od10

    type Od10[T] = Od1[Od0[T]]

    Od11

    type Od11[T] = Od1[Od1[T]]

    Od12

    type Od12[T] = Od1[Od2[T]]

    Od13

    type Od13[T] = Od1[Od3[T]]

    Od14

    type Od14[T] = Od1[Od4[T]]

    Od15

    type Od15[T] = Od1[Od5[T]]

    Od16

    type Od16[T] = Od1[Od6[T]]

    Od17

    type Od17[T] = Od1[Od7[T]]

    Od18

    type Od18[T] = Od1[Od8[T]]

    Od19

    type Od19[T] = Od1[Od9[T]]

    Od20

    type Od20[T] = Od2[Od0[T]]

    Od21

    type Od21[T] = Od2[Od1[T]]

    Od22

    type Od22[T] = Od2[Od2[T]]

    Od23

    type Od23[T] = Od2[Od3[T]]

    Od24

    type Od24[T] = Od2[Od4[T]]

    Od25

    type Od25[T] = Od2[Od5[T]]

    Od26

    type Od26[T] = Od2[Od6[T]]

    Od27

    type Od27[T] = Od2[Od7[T]]

    Od28

    type Od28[T] = Od2[Od8[T]]

    Od29

    type Od29[T] = Od2[Od9[T]]

    Od30

    type Od30[T] = Od3[Od0[T]]

    Od31

    type Od31[T] = Od3[Od1[T]]

    Od32

    type Od32[T] = Od3[Od2[T]]

    Od33

    type Od33[T] = Od3[Od3[T]]

    Od34

    type Od34[T] = Od3[Od4[T]]

    Od35

    type Od35[T] = Od3[Od5[T]]

    Od36

    type Od36[T] = Od3[Od6[T]]

    Od37

    type Od37[T] = Od3[Od7[T]]

    Od38

    type Od38[T] = Od3[Od8[T]]

    Od39

    type Od39[T] = Od3[Od9[T]]

    Od40

    type Od40[T] = Od4[Od0[T]]

    Od41

    type Od41[T] = Od4[Od1[T]]

    Od42

    type Od42[T] = Od4[Od2[T]]

    Od43

    type Od43[T] = Od4[Od3[T]]

    Od44

    type Od44[T] = Od4[Od4[T]]

    Od45

    type Od45[T] = Od4[Od5[T]]

    Od46

    type Od46[T] = Od4[Od6[T]]

    Od47

    type Od47[T] = Od4[Od7[T]]

    Od48

    type Od48[T] = Od4[Od8[T]]

    Od49

    type Od49[T] = Od4[Od9[T]]

    Od50

    type Od50[T] = Od5[Od0[T]]

    Od51

    type Od51[T] = Od5[Od1[T]]

    Od52

    type Od52[T] = Od5[Od2[T]]

    Od53

    type Od53[T] = Od5[Od3[T]]

    Od54

    type Od54[T] = Od5[Od4[T]]

    Od55

    type Od55[T] = Od5[Od5[T]]

    Od56

    type Od56[T] = Od5[Od6[T]]

    Od57

    type Od57[T] = Od5[Od7[T]]

    Od58

    type Od58[T] = Od5[Od8[T]]

    Od59

    type Od59[T] = Od5[Od9[T]]

    Od60

    type Od60[T] = Od6[Od0[T]]

    Od61

    type Od61[T] = Od6[Od1[T]]

    Od62

    type Od62[T] = Od6[Od2[T]]

    Od63

    type Od63[T] = Od6[Od3[T]]

    Od64

    type Od64[T] = Od6[Od4[T]]

    Od65

    type Od65[T] = Od6[Od5[T]]

    Od66

    type Od66[T] = Od6[Od6[T]]

    Od67

    type Od67[T] = Od6[Od7[T]]

    Od68

    type Od68[T] = Od6[Od8[T]]

    Od69

    type Od69[T] = Od6[Od9[T]]

    Od70

    type Od70[T] = Od7[Od0[T]]

    Od71

    type Od71[T] = Od7[Od1[T]]

    Od72

    type Od72[T] = Od7[Od2[T]]

    Od73

    type Od73[T] = Od7[Od3[T]]

    Od74

    type Od74[T] = Od7[Od4[T]]

    Od75

    type Od75[T] = Od7[Od5[T]]

    Od76

    type Od76[T] = Od7[Od6[T]]

    Od77

    type Od77[T] = Od7[Od7[T]]

    Od78

    type Od78[T] = Od7[Od8[T]]

    Od79

    type Od79[T] = Od7[Od9[T]]

    Od80

    type Od80[T] = Od8[Od0[T]]

    Od81

    type Od81[T] = Od8[Od1[T]]

    Od82

    type Od82[T] = Od8[Od2[T]]

    Od83

    type Od83[T] = Od8[Od3[T]]

    Od84

    type Od84[T] = Od8[Od4[T]]

    Od85

    type Od85[T] = Od8[Od5[T]]

    Od86

    type Od86[T] = Od8[Od6[T]]

    Od87

    type Od87[T] = Od8[Od7[T]]

    Od88

    type Od88[T] = Od8[Od8[T]]

    Od89

    type Od89[T] = Od8[Od9[T]]

    Od90

    type Od90[T] = Od9[Od0[T]]

    Od91

    type Od91[T] = Od9[Od1[T]]

    Od92

    type Od92[T] = Od9[Od2[T]]

    Od93

    type Od93[T] = Od9[Od3[T]]

    Od94

    type Od94[T] = Od9[Od4[T]]

    Od95

    type Od95[T] = Od9[Od5[T]]

    Od96

    type Od96[T] = Od9[Od6[T]]

    Od97

    type Od97[T] = Od9[Od7[T]]

    Od98

    type Od98[T] = Od9[Od8[T]]

    Od99

    type Od99[T] = Od9[Od9[T]]

    Ox00

    type Ox00[T] = Ox0[Ox0[T]]

    Ox01

    type Ox01[T] = Ox0[Ox1[T]]

    Ox02

    type Ox02[T] = Ox0[Ox2[T]]

    Ox03

    type Ox03[T] = Ox0[Ox3[T]]

    Ox04

    type Ox04[T] = Ox0[Ox4[T]]

    Ox05

    type Ox05[T] = Ox0[Ox5[T]]

    Ox06

    type Ox06[T] = Ox0[Ox6[T]]

    Ox07

    type Ox07[T] = Ox0[Ox7[T]]

    Ox08

    type Ox08[T] = Ox0[Ox8[T]]

    Ox09

    type Ox09[T] = Ox0[Ox9[T]]

    Ox0A

    type Ox0A[T] = Ox0[OxA[T]]

    Ox0B

    type Ox0B[T] = Ox0[OxB[T]]

    Ox0C

    type Ox0C[T] = Ox0[OxC[T]]

    Ox0D

    type Ox0D[T] = Ox0[OxD[T]]

    Ox0E

    type Ox0E[T] = Ox0[OxE[T]]

    Ox0F

    type Ox0F[T] = Ox0[OxF[T]]

    Ox10

    type Ox10[T] = Ox1[Ox0[T]]

    Ox11

    type Ox11[T] = Ox1[Ox1[T]]

    Ox12

    type Ox12[T] = Ox1[Ox2[T]]

    Ox13

    type Ox13[T] = Ox1[Ox3[T]]

    Ox14

    type Ox14[T] = Ox1[Ox4[T]]

    Ox15

    type Ox15[T] = Ox1[Ox5[T]]

    Ox16

    type Ox16[T] = Ox1[Ox6[T]]

    Ox17

    type Ox17[T] = Ox1[Ox7[T]]

    Ox18

    type Ox18[T] = Ox1[Ox8[T]]

    Ox19

    type Ox19[T] = Ox1[Ox9[T]]

    Ox1A

    type Ox1A[T] = Ox1[OxA[T]]

    Ox1B

    type Ox1B[T] = Ox1[OxB[T]]

    Ox1C

    type Ox1C[T] = Ox1[OxC[T]]

    Ox1D

    type Ox1D[T] = Ox1[OxD[T]]

    Ox1E

    type Ox1E[T] = Ox1[OxE[T]]

    Ox1F

    type Ox1F[T] = Ox1[OxF[T]]

    Ox20

    type Ox20[T] = Ox2[Ox0[T]]

    Ox21

    type Ox21[T] = Ox2[Ox1[T]]

    Ox22

    type Ox22[T] = Ox2[Ox2[T]]

    Ox23

    type Ox23[T] = Ox2[Ox3[T]]

    Ox24

    type Ox24[T] = Ox2[Ox4[T]]

    Ox25

    type Ox25[T] = Ox2[Ox5[T]]

    Ox26

    type Ox26[T] = Ox2[Ox6[T]]

    Ox27

    type Ox27[T] = Ox2[Ox7[T]]

    Ox28

    type Ox28[T] = Ox2[Ox8[T]]

    Ox29

    type Ox29[T] = Ox2[Ox9[T]]

    Ox2A

    type Ox2A[T] = Ox2[OxA[T]]

    Ox2B

    type Ox2B[T] = Ox2[OxB[T]]

    Ox2C

    type Ox2C[T] = Ox2[OxC[T]]

    Ox2D

    type Ox2D[T] = Ox2[OxD[T]]

    Ox2E

    type Ox2E[T] = Ox2[OxE[T]]

    Ox2F

    type Ox2F[T] = Ox2[OxF[T]]

    Ox30

    type Ox30[T] = Ox3[Ox0[T]]

    Ox31

    type Ox31[T] = Ox3[Ox1[T]]

    Ox32

    type Ox32[T] = Ox3[Ox2[T]]

    Ox33

    type Ox33[T] = Ox3[Ox3[T]]

    Ox34

    type Ox34[T] = Ox3[Ox4[T]]

    Ox35

    type Ox35[T] = Ox3[Ox5[T]]

    Ox36

    type Ox36[T] = Ox3[Ox6[T]]

    Ox37

    type Ox37[T] = Ox3[Ox7[T]]

    Ox38

    type Ox38[T] = Ox3[Ox8[T]]

    Ox39

    type Ox39[T] = Ox3[Ox9[T]]

    Ox3A

    type Ox3A[T] = Ox3[OxA[T]]

    Ox3B

    type Ox3B[T] = Ox3[OxB[T]]

    Ox3C

    type Ox3C[T] = Ox3[OxC[T]]

    Ox3D

    type Ox3D[T] = Ox3[OxD[T]]

    Ox3E

    type Ox3E[T] = Ox3[OxE[T]]

    Ox3F

    type Ox3F[T] = Ox3[OxF[T]]

    Ox40

    type Ox40[T] = Ox4[Ox0[T]]

    Ox41

    type Ox41[T] = Ox4[Ox1[T]]

    Ox42

    type Ox42[T] = Ox4[Ox2[T]]

    Ox43

    type Ox43[T] = Ox4[Ox3[T]]

    Ox44

    type Ox44[T] = Ox4[Ox4[T]]

    Ox45

    type Ox45[T] = Ox4[Ox5[T]]

    Ox46

    type Ox46[T] = Ox4[Ox6[T]]

    Ox47

    type Ox47[T] = Ox4[Ox7[T]]

    Ox48

    type Ox48[T] = Ox4[Ox8[T]]

    Ox49

    type Ox49[T] = Ox4[Ox9[T]]

    Ox4A

    type Ox4A[T] = Ox4[OxA[T]]

    Ox4B

    type Ox4B[T] = Ox4[OxB[T]]

    Ox4C

    type Ox4C[T] = Ox4[OxC[T]]

    Ox4D

    type Ox4D[T] = Ox4[OxD[T]]

    Ox4E

    type Ox4E[T] = Ox4[OxE[T]]

    Ox4F

    type Ox4F[T] = Ox4[OxF[T]]

    Ox50

    type Ox50[T] = Ox5[Ox0[T]]

    Ox51

    type Ox51[T] = Ox5[Ox1[T]]

    Ox52

    type Ox52[T] = Ox5[Ox2[T]]

    Ox53

    type Ox53[T] = Ox5[Ox3[T]]

    Ox54

    type Ox54[T] = Ox5[Ox4[T]]

    Ox55

    type Ox55[T] = Ox5[Ox5[T]]

    Ox56

    type Ox56[T] = Ox5[Ox6[T]]

    Ox57

    type Ox57[T] = Ox5[Ox7[T]]

    Ox58

    type Ox58[T] = Ox5[Ox8[T]]

    Ox59

    type Ox59[T] = Ox5[Ox9[T]]

    Ox5A

    type Ox5A[T] = Ox5[OxA[T]]

    Ox5B

    type Ox5B[T] = Ox5[OxB[T]]

    Ox5C

    type Ox5C[T] = Ox5[OxC[T]]

    Ox5D

    type Ox5D[T] = Ox5[OxD[T]]

    Ox5E

    type Ox5E[T] = Ox5[OxE[T]]

    Ox5F

    type Ox5F[T] = Ox5[OxF[T]]

    Ox60

    type Ox60[T] = Ox6[Ox0[T]]

    Ox61

    type Ox61[T] = Ox6[Ox1[T]]

    Ox62

    type Ox62[T] = Ox6[Ox2[T]]

    Ox63

    type Ox63[T] = Ox6[Ox3[T]]

    Ox64

    type Ox64[T] = Ox6[Ox4[T]]

    Ox65

    type Ox65[T] = Ox6[Ox5[T]]

    Ox66

    type Ox66[T] = Ox6[Ox6[T]]

    Ox67

    type Ox67[T] = Ox6[Ox7[T]]

    Ox68

    type Ox68[T] = Ox6[Ox8[T]]

    Ox69

    type Ox69[T] = Ox6[Ox9[T]]

    Ox6A

    type Ox6A[T] = Ox6[OxA[T]]

    Ox6B

    type Ox6B[T] = Ox6[OxB[T]]

    Ox6C

    type Ox6C[T] = Ox6[OxC[T]]

    Ox6D

    type Ox6D[T] = Ox6[OxD[T]]

    Ox6E

    type Ox6E[T] = Ox6[OxE[T]]

    Ox6F

    type Ox6F[T] = Ox6[OxF[T]]

    Ox70

    type Ox70[T] = Ox7[Ox0[T]]

    Ox71

    type Ox71[T] = Ox7[Ox1[T]]

    Ox72

    type Ox72[T] = Ox7[Ox2[T]]

    Ox73

    type Ox73[T] = Ox7[Ox3[T]]

    Ox74

    type Ox74[T] = Ox7[Ox4[T]]

    Ox75

    type Ox75[T] = Ox7[Ox5[T]]

    Ox76

    type Ox76[T] = Ox7[Ox6[T]]

    Ox77

    type Ox77[T] = Ox7[Ox7[T]]

    Ox78

    type Ox78[T] = Ox7[Ox8[T]]

    Ox79

    type Ox79[T] = Ox7[Ox9[T]]

    Ox7A

    type Ox7A[T] = Ox7[OxA[T]]

    Ox7B

    type Ox7B[T] = Ox7[OxB[T]]

    Ox7C

    type Ox7C[T] = Ox7[OxC[T]]

    Ox7D

    type Ox7D[T] = Ox7[OxD[T]]

    Ox7E

    type Ox7E[T] = Ox7[OxE[T]]

    Ox7F

    type Ox7F[T] = Ox7[OxF[T]]

    Ox80

    type Ox80[T] = Ox8[Ox0[T]]

    Ox81

    type Ox81[T] = Ox8[Ox1[T]]

    Ox82

    type Ox82[T] = Ox8[Ox2[T]]

    Ox83

    type Ox83[T] = Ox8[Ox3[T]]

    Ox84

    type Ox84[T] = Ox8[Ox4[T]]

    Ox85

    type Ox85[T] = Ox8[Ox5[T]]

    Ox86

    type Ox86[T] = Ox8[Ox6[T]]

    Ox87

    type Ox87[T] = Ox8[Ox7[T]]

    Ox88

    type Ox88[T] = Ox8[Ox8[T]]

    Ox89

    type Ox89[T] = Ox8[Ox9[T]]

    Ox8A

    type Ox8A[T] = Ox8[OxA[T]]

    Ox8B

    type Ox8B[T] = Ox8[OxB[T]]

    Ox8C

    type Ox8C[T] = Ox8[OxC[T]]

    Ox8D

    type Ox8D[T] = Ox8[OxD[T]]

    Ox8E

    type Ox8E[T] = Ox8[OxE[T]]

    Ox8F

    type Ox8F[T] = Ox8[OxF[T]]

    Ox90

    type Ox90[T] = Ox9[Ox0[T]]

    Ox91

    type Ox91[T] = Ox9[Ox1[T]]

    Ox92

    type Ox92[T] = Ox9[Ox2[T]]

    Ox93

    type Ox93[T] = Ox9[Ox3[T]]

    Ox94

    type Ox94[T] = Ox9[Ox4[T]]

    Ox95

    type Ox95[T] = Ox9[Ox5[T]]

    Ox96

    type Ox96[T] = Ox9[Ox6[T]]

    Ox97

    type Ox97[T] = Ox9[Ox7[T]]

    Ox98

    type Ox98[T] = Ox9[Ox8[T]]

    Ox99

    type Ox99[T] = Ox9[Ox9[T]]

    Ox9A

    type Ox9A[T] = Ox9[OxA[T]]

    Ox9B

    type Ox9B[T] = Ox9[OxB[T]]

    Ox9C

    type Ox9C[T] = Ox9[OxC[T]]

    Ox9D

    type Ox9D[T] = Ox9[OxD[T]]

    Ox9E

    type Ox9E[T] = Ox9[OxE[T]]

    Ox9F

    type Ox9F[T] = Ox9[OxF[T]]

    OxA0

    type OxA0[T] = OxA[Ox0[T]]

    OxA1

    type OxA1[T] = OxA[Ox1[T]]

    OxA2

    type OxA2[T] = OxA[Ox2[T]]

    OxA3

    type OxA3[T] = OxA[Ox3[T]]

    OxA4

    type OxA4[T] = OxA[Ox4[T]]

    OxA5

    type OxA5[T] = OxA[Ox5[T]]

    OxA6

    type OxA6[T] = OxA[Ox6[T]]

    OxA7

    type OxA7[T] = OxA[Ox7[T]]

    OxA8

    type OxA8[T] = OxA[Ox8[T]]

    OxA9

    type OxA9[T] = OxA[Ox9[T]]

    OxAA

    type OxAA[T] = OxA[OxA[T]]

    OxAB

    type OxAB[T] = OxA[OxB[T]]

    OxAC

    type OxAC[T] = OxA[OxC[T]]

    OxAD

    type OxAD[T] = OxA[OxD[T]]

    OxAE

    type OxAE[T] = OxA[OxE[T]]

    OxAF

    type OxAF[T] = OxA[OxF[T]]

    OxB0

    type OxB0[T] = OxB[Ox0[T]]

    OxB1

    type OxB1[T] = OxB[Ox1[T]]

    OxB2

    type OxB2[T] = OxB[Ox2[T]]

    OxB3

    type OxB3[T] = OxB[Ox3[T]]

    OxB4

    type OxB4[T] = OxB[Ox4[T]]

    OxB5

    type OxB5[T] = OxB[Ox5[T]]

    OxB6

    type OxB6[T] = OxB[Ox6[T]]

    OxB7

    type OxB7[T] = OxB[Ox7[T]]

    OxB8

    type OxB8[T] = OxB[Ox8[T]]

    OxB9

    type OxB9[T] = OxB[Ox9[T]]

    OxBA

    type OxBA[T] = OxB[OxA[T]]

    OxBB

    type OxBB[T] = OxB[OxB[T]]

    OxBC

    type OxBC[T] = OxB[OxC[T]]

    OxBD

    type OxBD[T] = OxB[OxD[T]]

    OxBE

    type OxBE[T] = OxB[OxE[T]]

    OxBF

    type OxBF[T] = OxB[OxF[T]]

    OxC0

    type OxC0[T] = OxC[Ox0[T]]

    OxC1

    type OxC1[T] = OxC[Ox1[T]]

    OxC2

    type OxC2[T] = OxC[Ox2[T]]

    OxC3

    type OxC3[T] = OxC[Ox3[T]]

    OxC4

    type OxC4[T] = OxC[Ox4[T]]

    OxC5

    type OxC5[T] = OxC[Ox5[T]]

    OxC6

    type OxC6[T] = OxC[Ox6[T]]

    OxC7

    type OxC7[T] = OxC[Ox7[T]]

    OxC8

    type OxC8[T] = OxC[Ox8[T]]

    OxC9

    type OxC9[T] = OxC[Ox9[T]]

    OxCA

    type OxCA[T] = OxC[OxA[T]]

    OxCB

    type OxCB[T] = OxC[OxB[T]]

    OxCC

    type OxCC[T] = OxC[OxC[T]]

    OxCD

    type OxCD[T] = OxC[OxD[T]]

    OxCE

    type OxCE[T] = OxC[OxE[T]]

    OxCF

    type OxCF[T] = OxC[OxF[T]]

    OxD0

    type OxD0[T] = OxD[Ox0[T]]

    OxD1

    type OxD1[T] = OxD[Ox1[T]]

    OxD2

    type OxD2[T] = OxD[Ox2[T]]

    OxD3

    type OxD3[T] = OxD[Ox3[T]]

    OxD4

    type OxD4[T] = OxD[Ox4[T]]

    OxD5

    type OxD5[T] = OxD[Ox5[T]]

    OxD6

    type OxD6[T] = OxD[Ox6[T]]

    OxD7

    type OxD7[T] = OxD[Ox7[T]]

    OxD8

    type OxD8[T] = OxD[Ox8[T]]

    OxD9

    type OxD9[T] = OxD[Ox9[T]]

    OxDA

    type OxDA[T] = OxD[OxA[T]]

    OxDB

    type OxDB[T] = OxD[OxB[T]]

    OxDC

    type OxDC[T] = OxD[OxC[T]]

    OxDD

    type OxDD[T] = OxD[OxD[T]]

    OxDE

    type OxDE[T] = OxD[OxE[T]]

    OxDF

    type OxDF[T] = OxD[OxF[T]]

    OxE0

    type OxE0[T] = OxE[Ox0[T]]

    OxE1

    type OxE1[T] = OxE[Ox1[T]]

    OxE2

    type OxE2[T] = OxE[Ox2[T]]

    OxE3

    type OxE3[T] = OxE[Ox3[T]]

    OxE4

    type OxE4[T] = OxE[Ox4[T]]

    OxE5

    type OxE5[T] = OxE[Ox5[T]]

    OxE6

    type OxE6[T] = OxE[Ox6[T]]

    OxE7

    type OxE7[T] = OxE[Ox7[T]]

    OxE8

    type OxE8[T] = OxE[Ox8[T]]

    OxE9

    type OxE9[T] = OxE[Ox9[T]]

    OxEA

    type OxEA[T] = OxE[OxA[T]]

    OxEB

    type OxEB[T] = OxE[OxB[T]]

    OxEC

    type OxEC[T] = OxE[OxC[T]]

    OxED

    type OxED[T] = OxE[OxD[T]]

    OxEE

    type OxEE[T] = OxE[OxE[T]]

    OxEF

    type OxEF[T] = OxE[OxF[T]]

    OxF0

    type OxF0[T] = OxF[Ox0[T]]

    OxF1

    type OxF1[T] = OxF[Ox1[T]]

    OxF2

    type OxF2[T] = OxF[Ox2[T]]

    OxF3

    type OxF3[T] = OxF[Ox3[T]]

    OxF4

    type OxF4[T] = OxF[Ox4[T]]

    OxF5

    type OxF5[T] = OxF[Ox5[T]]

    OxF6

    type OxF6[T] = OxF[Ox6[T]]

    OxF7

    type OxF7[T] = OxF[Ox7[T]]

    OxF8

    type OxF8[T] = OxF[Ox8[T]]

    OxF9

    type OxF9[T] = OxF[Ox9[T]]

    OxFA

    type OxFA[T] = OxF[OxA[T]]

    OxFB

    type OxFB[T] = OxF[OxB[T]]

    OxFC

    type OxFC[T] = OxF[OxC[T]]

    OxFD

    type OxFD[T] = OxF[OxD[T]]

    OxFE

    type OxFE[T] = OxF[OxE[T]]

    OxFF

    type OxFF[T] = OxF[OxF[T]]

    ToInt

    trait ToInt

    ToUInt64

    trait ToUInt64

    Od0

    type Od0[_]

    impl ToInt for Od0[T]
    impl ToUInt64 for Od0[T]

    Od1

    type Od1[_]

    impl ToInt for Od1[T]
    impl ToUInt64 for Od1[T]

    Od2

    type Od2[_]

    impl ToInt for Od2[T]
    impl ToUInt64 for Od2[T]

    Od3

    type Od3[_]

    impl ToInt for Od3[T]
    impl ToUInt64 for Od3[T]

    Od4

    type Od4[_]

    impl ToInt for Od4[T]
    impl ToUInt64 for Od4[T]

    Od5

    type Od5[_]

    impl ToInt for Od5[T]
    impl ToUInt64 for Od5[T]

    Od6

    type Od6[_]

    impl ToInt for Od6[T]
    impl ToUInt64 for Od6[T]

    Od7

    type Od7[_]

    impl ToInt for Od7[T]
    impl ToUInt64 for Od7[T]

    Od8

    type Od8[_]

    impl ToInt for Od8[T]
    impl ToUInt64 for Od8[T]

    Od9

    type Od9[_]

    impl ToInt for Od9[T]
    impl ToUInt64 for Od9[T]

    Ox0

    type Ox0[_]

    impl ToInt for Ox0[T]
    impl ToUInt64 for Ox0[T]

    Ox1

    type Ox1[_]

    impl ToInt for Ox1[T]
    impl ToUInt64 for Ox1[T]

    Ox2

    type Ox2[_]

    impl ToInt for Ox2[T]
    impl ToUInt64 for Ox2[T]

    Ox3

    type Ox3[_]

    impl ToInt for Ox3[T]
    impl ToUInt64 for Ox3[T]

    Ox4

    type Ox4[_]

    impl ToInt for Ox4[T]
    impl ToUInt64 for Ox4[T]

    Ox5

    type Ox5[_]

    impl ToInt for Ox5[T]
    impl ToUInt64 for Ox5[T]

    Ox6

    type Ox6[_]

    impl ToInt for Ox6[T]
    impl ToUInt64 for Ox6[T]

    Ox7

    type Ox7[_]

    impl ToInt for Ox7[T]
    impl ToUInt64 for Ox7[T]

    Ox8

    type Ox8[_]

    impl ToInt for Ox8[T]
    impl ToUInt64 for Ox8[T]

    Ox9

    type Ox9[_]

    impl ToInt for Ox9[T]
    impl ToUInt64 for Ox9[T]

    OxA

    type OxA[_]

    impl ToInt for OxA[T]
    impl ToUInt64 for OxA[T]

    OxB

    type OxB[_]

    impl ToInt for OxB[T]
    impl ToUInt64 for OxB[T]

    OxC

    type OxC[_]

    impl ToInt for OxC[T]
    impl ToUInt64 for OxC[T]

    OxD

    type OxD[_]

    impl ToInt for OxD[T]
    impl ToUInt64 for OxD[T]

    OxE

    type OxE[_]

    impl ToInt for OxE[T]
    impl ToUInt64 for OxE[T]

    OxF

    type OxF[_]

    impl ToInt for OxF[T]
    impl ToUInt64 for OxF[T]
    type Z

    impl ToInt for Z
    impl ToUInt64 for Z

    to_int

    fn[T : ToInt] to_int(_ : (T) -> Unit) -> Int

    to_uint64

    fn[T : ToUInt64] to_uint64(_ : (T) -> Unit) -> UInt64