type-level-numbers

Type level numbers implemented using type families.

Version on this page:0.1.1.1
LTS Haskell 8.6:0.1.1.1
Stackage Nightly 2017-03-29:0.1.1.1
Latest on Hackage:0.1.1.1
BSD3 licensed and maintained by Alexey Khudyakov

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.

Changes

Changes in 0.1.1.1

* Type level addition is fixed for GHC 7.6

* Test suite added to cabal file


Changes in 0.1.1.0

* withNat, withInt, SomeNat and SomeInt added.


Changes in 0.1.0.3

* Fix build for GHC 7.4


Changes in 0.1.0.2:

* Fix URL in cabal file

Changes in 0.1.0.1:

* Workaround for GHC bug #4364 (Build failure on GHC 7.0)
Used by 1 package:
comments powered byDisqus