[Haskell-cafe] Announce type-level-natural-number-1.0: Simple,
Haskell 2010-compatible type level natural numbers
Gregory Crosswhite
gcross at phys.washington.edu
Fri Jul 30 16:28:19 EDT 2010
Hey everyone,
I am pleased to announce the release of the "type-level-natural-number"
package, which implements natural numbers at the type level. Although
there are many packages on Hackage that implement type level natural
numbers, this package is distinguished by its simplicity: it does not
offer any operations other than predecessor, successor, and conversion
to Int, and so the only Haskell extension it needs is EmptyDataDecls.
Thus, this package is compatible with Haskell 2010.
The envisioned use case is for annotating types with natural numbers, so
that extra functionality such as addition and subtraction of natural
numbers is unnecessary. Nothing is stopping someone from implementing
this functionality, and in fact I may do so myself; however, since such
functionality is not needed merely for using these numbers, I decided to
leave it out in order to avoid having to use non-Haskell 2010 extensions
(especially UndecidableInstances). In particular, a major motivation
behind designing the package in this way is to make it more appealing as
a standard means for representing natural number annotations in order to
promote interoperability between libraries.
I welcome any feedback that the community has to offer.
Cheers,
Gregory Crosswhite
More information about the Haskell-Cafe
mailing list