Type-Level Instant Insanity
We illuminate some of the techniques used to perform computations in The Haskell Type System by presenting a complete type-level program. Programming at this level is often considered an obscure art with little practical value, but it need not be so. We introduce constructs equivalent to list comprehensions, maps and filters of conventional functional programming, and in so doing make clear the mechanical techniques required to construct programs in this manner. Only after building an understanding of the syntactical oddities and transformations involved in programming in The Haskell Type System do we consider the practical aspects of using these techniques in conventional Haskell programming.