Simple skeleton for Haskell programs

by Mithrandir

At my university, there is a course named Programming Paradigms. One of the four languages studied there is Haskell. At a very basic level: type inference, laziness, type classes, pattern matching. No monads, no advanced concepts.

However, there is a Haskell homework and this year we want to test it automatically using vmchecker. This means that the students need to have a skeleton for the I/O parts of the application. In the past, we provided this skeleton but it was always changed from year to year. This time, I’ve tried implementing a generic one.

Thus, io-manager was created. You simply change the Makefile and the main file, run make and run the application providing as command line arguments all the input files that you need. The student only uses simple functions to write/read from this files. In fact, these are simulated, the reads are done lazily before starting the student’s code and the writes are done at the end of the application. All student’s code is pure.

For now there is one enhancement: there should be a cabal file to allow for

cabal install io-manager

in the future.

Entire code is on GitHub, please improve or comment :)

About these ads