A Reflection on Types

Simon Peyton Jones, Microsoft Research, Cambridge
Stephanie Weirich, University of Pennsylvania
Richard A. Eisenberg, Bryn Mawr College
Dimitrios Vytiniotis, Microsoft Research, Cambridge

Abstract

The ability to perform type tests at runtime blurs the line between statically-typed and dynamically-checked languages. Recent developments in Haskell's type system allow even programs that use reflection to themselves be statically typed, using a type-indexed runtime representation of types called TypeRep. As a result we can build dynamic types as an ordinary, statically-typed library, on top of TypeRep in an open-world context.