PaackEng / paack-ui / UI.Utils.TypeNumbers

This module contains phantom-types for helping guarantee lengths in collectibles.

The UI.Table uses this for constraining all rows dimensions.

type alias CoolTable columns =
    { header : NList String columns
    , rows : NLIst Int columns
    }

Primitives


type alias Zero =
Basics.Never

Represents the size of an empty set.


type Increase a

Represents an recursively incremented size.

pushItem : Items n -> Items (Increase n)

popItem : Items (Increase n) -> Items n

Descendents


type alias One =
Increase Zero

Equivalent to (Increase Zero)


type alias Two =
Increase One

Equivalent to (Increase (Increase Zero))


type alias Three =
Increase Two

Equivalent to (Increase (Increase (Increase Zero)))


type alias Four =
Increase Three

Equivalent to (Increase Three)


type alias Five =
Increase Four

Equivalent to (Increase Four)


type alias Six =
Increase Five

Equivalent to (Increase Five)


type alias Seven =
Increase Six

Equivalent to (Increase Six)


type alias Eight =
Increase Seven

Equivalent to (Increase Seven)


type alias Nine =
Increase Eight

Equivalent to (Increase Eight)


type alias Decimal base =
Increase (Increase (Increase (Increase (Increase (Increase (Increase (Increase (Increase (Increase base)))))))))

Used to compose numbers greater than nine.

(Decimal (Decimal Zero)) is equivalent to 20.