The aim of this project would be to create a GHC plugin that allows instructors to define requirements for the code within a project and automatically validate them. This plugin would have applications for users in a broad range of educational contexts, such as university professors teaching functional programming classes using Haskell, community members writing tutorials for their libraries, and authors who are writing textbooks with exercises.
It would offer validation of requirements from basic static analysis like whitelisting/blacklisting of standard library symbols and checks for line length and warnings through to more advanced runtime testing involving checking that functions in the given code pass specified unit tests.
The structure of the project would be to create a domain-specific language for expressing the requirements, then to write the plugin, which would enforce the specified requirements. This would happen by injecting new code into the program to check for a specific “validation mode”, which replaces the original behaviour of the program with any necessary runtime validation, and replaces its output with a report about how well the code follows the requirements.