type-level-numbers

Type level numbers implemented using type families.

LTS Haskell 13.26:0.1.1.1
Stackage Nightly 2019-06-26:0.1.1.1
Latest on Hackage:0.1.1.1

See all snapshots type-level-numbers appears in

BSD-3-Clause licensed and maintained by Alexey Khudyakov

Module documentation for 0.1.1.1

This version can be pinned in stack with:type-level-numbers-0.1.1.1@sha256:40b58b311b27004efa6cd851e401b507ccf31d0a04b215740e726d0691c174b8,2290

This is type level numbers implemented using type families. Natural numbers use binary encoding. With default context stack numbers up to 2^18-1 coudl 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.

comments powered byDisqus