Lab 4 Functional Programming 2013, TDA 452, DIT 142
Last updated 22-11-2013
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; make sure that if you choose an ambitious project you should be able to demonstrate your progress even if the whole code is not complete.
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. Yesod, Happstack, Snap)
- GUI/Graphics (e.g. GTK2HS, OpenGL, Gloss,
- Other testing suites e.g. HUnit
- More performance oriented IO/data (ByteStrings, many libraries for efficient data structures)
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 Friday 29 November in the Fire system. When accepted, you will be mailed a link to a sign-up page for your presentation, either on 11 or 12th December.
- Upload project source code to Fire (and any other supporting documents if you have any). The deadline for uploading your project is
midnight 11 December or 30 minutes before your presentation, whichever comes first.
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.
Replace the rather non-functional-style GTK library with a slightly more functional style version e.g. wxHaskell.
Be warned that wxHaskell 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. If you choose to do this popular project you must include some simple form of graphical output, and a parser for life text files of the format described in the wiki. Your parser should be built with the Parse.hs library described in the lecture.
- 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