Basil is a library for building data models in Haskell. It provides a way to encode ER models in Haskell at both the value- and the type-level. This enforces a number of constraints.
Using the ER model, Basil can generate an in-memory database or an interface to a relational database.
The code is very much in alpha state.
Have a look at Example3.lhs, it is the most recent example.