type-level-numbers

Type level numbers implemented using type families.

LTS Haskell 22.43:0.1.1.2
Stackage Nightly 2024-11-24:0.1.1.2
Latest on Hackage:0.1.1.2

See all snapshots type-level-numbers appears in

BSD-3-Clause licensed and maintained by Alexey Khudyakov
This version can be pinned in stack with:type-level-numbers-0.1.1.2@sha256:1d9157ded05f6cdfa5b0dd44a1bbb0b7a8ba55a61785982047e734ed2b660376,2317

This is type level numbers implemented using type families. Natural numbers use binary encoding. With default context stack numbers up to 2^18-1 could be represented. Signed integer numbers use balanced ternary encoding.

Package is structured as folows:

  • [TypeLevel.Number.Classes] contain generic type families such as Add

  • [TypeLevel.Number.Nat] natural numbers implemented using binary encoding

  • [TypeLevel.Number.Int] signed integers implemented using balanced ternary encoding

  • [TypeLevel.Boolean] type level booleans

So far comparison of numbers, subtraction and multiplication of numbers are supported.