Typed reflection in Haskell
Proc Philip Wadler's 60th birthday Festschrift, Edinburgh, April 2016
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.