CoddFish makes extensive use of heterogenous collections and type-level programming.
A relational database is modeled as a heterogeneous collection of tables. A table, in turn, is modeled as a heterogeneous collection of attributes (the header of the table) and a Map of key values to non-key values (the rows of the table). Both the key and non-key values are stored again in a heterogeneous collection. In addition, heterogeneous collections are used to model the arguments and results of database operations, and to model functional dependencies.
Type-level programming is used to maintain the consistency between header and rows, and between functional dependencies and tables. Type-level predicates are provided to check whether tables and functional dependencies are in particular normal-forms, or not.
The essentials of CoddFish are described in the following paper:
Alexandra Silva and Joost Visser, Strong Types for Relational Databases (Functional Pearl). In Proceedings of Haskell Workshop 2006, to appear. pdf
Generated documentation of the API of CoddFish will appear here.