The type-level-natural-number package
This is a simple, Haskell 2010 compatible implementation of type-level natural numbers. Operations requiring non-Haskell 2010 language extensions have been split into a separate package.
The difference between this package and the many others on Hackage implementing type-level naturals is its emphasis on simplicity. It only supports non-negative natural numbers, and only the successor and predicessor operations. It represents natural numbers using a type-level linked list, so it is not intended to be used for representing large numbers. Pre-defined aliases for natural numbers up to 15 are provided.
The code for this package was largely taken from the excellent Vec package; I created this package with the intent of making this functionality more widely available.
Difference from 1.0: Added instances for Typeable, and word synonyms for N0...N15.
Properties
| Versions | 1.0, 1.1 |
|---|---|
| Dependencies | base (≥3 & <5) |
| License | BSD3 |
| Author | Gregory Crosswhite |
| Maintainer | Gregory Crosswhite <gcross@phys.washington.edu> |
| Stability | Provisional |
| Category | Type System, Data |
| Upload date | Thu Oct 14 01:22:57 UTC 2010 |
| Uploaded by | GregoryCrosswhite |
| Built on | ghc-6.12, ghc-7.0, ghc-7.2 |
Modules
- TypeLevel
Downloads
- type-level-natural-number-1.1.tar.gz (Cabal source package)
- package description (included in the package)