Lab 4 Functional Programming 2012, TDA 452, DIT 142
Last updated 27-11-2012
Lab 4 is an open-ended lab in which you can design and implement your own mini project. The idea is to give you the freedom to explore Haskell in a direction of your choosing. The project should take you around 20 hours of work working in a group of two, so it is best not to choose something too big - or at least if it is bit then you might not finish it but you should be able to demonstrate your progress.
For those of you who don't like the uncertainty that comes with such freedom, below we have suggested some more traditional labs that you can use as the basis of your project. These come from labs from this course or other courses. You won't be able to assume that we are familiar with all these labs however, but we will help if we can.
Guidelines for your projects
Depending on the level of difficulty of the programming task, it could be good to use of some nontrivial new Haskell libraries, for example
- Parsers (including the simple one from the lecture)
- Web frameworks (e.g. Yeosod)
- Graphics (e.g. OpenGL,wxHaskell,Diagrams)
- Other testing suites e.g. HUnit
- More performance oriented IO/data (ByteStrings, many libraries for efficient data structures)
It would also be very appropriate to use quickCheck properties for testing of functional code (if this is at all appropriate for your problem).
Unlike with the other labs we might not be able to help you with the specifics of libraries and tools that you might want to use. Fortunately the online Haskell community is a helpful bunch.
Projects will be presented with a 5 minute oral presentation (a projector will be available) explaining what the project is about and giving a quick demo. The code should be uploaded to Fire in advance so we can have it ready to browse during your presentation and can ask questions about the code. Be prepared to highlight and explain the more interesting/challenging parts of the code!
Any code which is imported or adapted from another source must be clearly acknowledged, even if it is your own earlier work.
- Submit short proposal: latest on Monday 3 Dec (but earlier is recommended) to this web form
- Upload of sources to Fire and presentation of your project: 12 Dec (there will be a sign-up page for time slots for your presentations).
Some Project/Lab Suggestions
The following are a list of suggestions -- old labs or labs from other courses -- which you can use as the basis for your "project".
- A function calculator
Project based on the old Lab 4 from 2011
This lab is quite nice, but part 2, building a GUI, does not really have much to do with functional programming. You should strongly consider some variations for part 2, such as replacing the gui part with simple graphics output - perhaps displayed in a web page
Replace the rather non-functional-style GTK library with a slightly more functional style version e.g. wxHaskell.
Be warned that GTK and perhaps other libraries can be a pain to install.
- The 9-men-morris game
Many small games make for nice mini projects. One example is 9-men-morris described in this course lab
This looks like a good level of difficulty, although the code from the instructor does not look like she is experienced with Haskell (e.g. using numbers and characters instead of new data types etc). You could consider starting from scratch or at least rewrite to use more data types.
- Conway's Game of Life with or without gui output.
- Programming language projects
Functional languages are ideal for implementing programming language tools such as compilers and interpreters. If you have some interest in this then here are a couple of labs which might form the basis for a project:
- Turtle Graphics Interpreter
Implementing an interpreter for turtle graphics programs is the first lab of the Advanced Functional Programming Course. Nice project but maybe you should't submit the same lab twice!
- A Bytecode Interpreter and Type Checker for a small stack-based byte code language.
This was a lab from a course in Programming Language Semantics. Only really suitable if you have seen operational semantics specifications before or are willing to learn (it is not too hard). Provides interesting challenges for testing.
You might also try implementing some other language - e.g. a functional language - (but there are similar labs in some other programming language courses at Chalmers).
- Logic projects
Encoding a reasonable range of Logic puzzles in a way that allows a Haskell program to solve them automatically.
Alternatively, if you are fresh out of the logic course from last period you might create a logic variant of the function calculator above, with parsing of logical expressions, computation of satisfiability, tautology checking, function-table construction, conversions to conjunctive-normal-form etc. etc.
Back to Home Page / To the course group