[Haskell-cafe] ANNOUNCE: type-level 0.1: Haskell type-level programming library

Alfonso Acosta alfonso.acosta at gmail.com
Wed Feb 27 23:50:42 EST 2008


The goal of the "Type-level" library is to standardize and extend the
features offered by the multiple (and heterogeneous) type-level
programming implementations already around.

To date, type-level Booleans and arbitrary sized Naturals  are supported.

I implemented a few things I didn't see in any other type-level
programming libraries:

* Numerals use decimal representation to make error reports friendlier.

* Type-level numerals can be intuitively typed in different bases
(although everything is internally represented in base 10) by using
aliases:

D16 represents the type-level decimal 16
B1010 represents the type-level binary 1010
076 represents the type-level octal 76
HFF represents the type-level hexadecimal FF

* All basic arithmetic operations are supported (including logarithm
and exponentiation in any base)

* The library provides reification of Naturals and Booleans (from
value-level to type-level) .

To get the code:

HackageDB page (including haddock documentation):
http://hackage.haskell.org/cgi-bin/hackage-scripts/package/type-level-0.1

Darcs repository: http://code.haskell.org/type-level/


Big Thanks to Oleg and Wolfgang for their suggestions and
contributions. Actually, most of the implementation of Naturals is
based on Oleg's  "Binary Type Arithmetic"
http://okmij.org/ftp/Haskell/types.html#binary-arithm


More information about the Haskell-Cafe mailing list