IMDEA Software

IMDEA initiative

Home > Events > Software Seminar Series > 2008 > Abusing the typechecker: type-level programming in Haskell

Tuesday, April 1, 2008

11:00am Meeting room 302 (Mountain View), level 3

Alfonso Acosta, Post-doctoral Researcher, Technical University of Madrid (UPM), Spain

Abusing the typechecker: type-level programming in Haskell

Abstract:

Type arithmetic (or type-level computations) are calculations over types.

Haskell lacks type-level lambdas and thus, one could say it also lacks native support for type arithmetic. However, it is possible to use multiparameter type classes (originally devised to support multiparameter function overloading) to implement type-level computations.

Some inmediate applications of type-level programming in Haskell are:

  • Heterogeneous lists and extensible records.
  • Emulation of dependent types, e.g. statically-safe vectors, in which the vector bounds can be checked at compile-time.

During the talk we will go through a simplified implementation of type-level Booleans and Naturals.