I'm reviving this old thread, because I am talking to a student who is interested in working on this as a project for Google Summer of Code. I'm happy to be a mentor, but this student could use another mentor who could help with GHC internals for building a GHC plugin.
The project would be to implement a domain-specific language for giving assignment or exercise requirements for Haskell programs, and a GHC plugin that allows the code to be run in a mode that validates those requirements. The plugin would inject code into the resulting program for running in validation mode to do the checks. Sometimes, the rules are about the source code -- e.g., "every top-level definition must be accompanied by a type signature", or "no lines longer than 80 characters", or "the program must use a list comprehension" -- in which case the plugin would look at the source code or AST at build time, check assertions about what's there, and inject trivial code to report the result when the program is run. Other times, rules could be about runtime properties or behavior, in which case the injected code would actually run tests to validate the behavior.
If anyone is interested in mentoring a student working on this project, please contact me and I'll pass along the info. (I cannot post the student's details publicly, because Summer of Code proposals aren't supposed to be public at this stage, but I can forward responses directly to the student involved.)
Thanks,
Chris