[Haskell-cafe] Type-Level Programming

Brandon S Allbery KF8NH allbery at ece.cmu.edu
Sat Jun 26 10:34:48 EDT 2010


-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

On 6/26/10 07:28 , Andrew Coppin wrote:
> Uh, don't types have values *now*?

To the extent that's true now, they're "baked in"; you can't do anything
to/with them.

> Oh, right. So you mean that as well as being able to say "Foo Bar", you can
> say "Foo 7", where 7 is (of course) a value rather than a type. (?)

A bit more than that:  imagine now that you can (a) replace that 7 with a
variable and (b) do math on it in a type declaration:

> -- borrowing 'typevar from ML for a moment...
> (SList 'a l) is a sized list of ('a) of length (l)
> sListConcat :: SList 'a l1 -> SList 'a l2 -> SList 'a (l1 + l2)

Just for starters.

- -- 
brandon s. allbery     [linux,solaris,freebsd,perl]      allbery at kf8nh.com
system administrator  [openafs,heimdal,too many hats]  allbery at ece.cmu.edu
electrical and computer engineering, carnegie mellon university      KF8NH
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.10 (Darwin)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/

iEYEARECAAYFAkwmD/YACgkQIn7hlCsL25UD8ACghqbV0MUtbfWrFN82yCmsdb4D
X44An2WUkBcuptAe4iz1Wl1t4j3y0NdL
=+6IT
-----END PGP SIGNATURE-----


More information about the Haskell-Cafe mailing list