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, if you so wish.
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 a complete "standard lab".
Below you will also find some further ideas
that you can use as the basis of your project. Some of 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
From our previous experience we suggest the following guidelines in choosing and developing a project:
Try to structure your project plan in stages so that you can have a "complete" project even if you do not manage to achieve all of your goals.
GUI libraries are often difficult to install (they are very
platform specific) and usually do not support a functional programming
style. We suggest that you minimise this. Neverthless, here are some
like in the Standard Lab. This means compiling your
your browser (which means you can run your program on any device with a
web browser, including smartphones).
See the intro to Part II
of the Standard Lab for some useful info on Haste.
Creating a user interface with threepenny-gui will be very similar to
using Haste. The user interface opens in your web browser,
but the program runs on your computer in GHCi
(or you can compile it with GHC).
See the intro to Part II
of the Standard Lab for some useful info on threepenny-gui.
This allows you to create and run graphics, animation and interactive games
online. You can also develop and run your programs locally by installing
but this library has a lot of dependencies, so it may take some
time to install it.
Other possibilites include
If you like cool vector graphics, you might find the
(see the tutorial
and the gallery, which has source code)
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. There is also a Haste google group and an IRC channel (#haskell-haste @ Freenode ).
What we expect to see in a project
We expect to see functional programming demonstrating:
- good functional style, including appropriate use of higher-order functions,
- appropriate modelling and use of data structures,
- appropriate use of property-based testing with quickCheck,
- clean separation between functional code and IO.
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.
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".
The Standard Lab.
This is a complete lab description in standard form. The description is split into several parts but you must submit the whole lab.
Most students who choose this lab in 2015 were happy with their choice.
The 9-men-morris game.
Many small games make for nice mini projects. One example is the
(You can play online).
The Game of Amazons.
A more sensible choice than trying to write a chess program - but still challenging. Like with many board games it can be solved in stages, where the first stage is to support a two-player game. Then if you have time you can try and build an AI. More online.
Tetris. A classic. But don't get too tied up in the GUI stuff.
Minesweeper. Another classic single-player game without any serious graphical needs. For more of a challenge you can try to write a solver.
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 labs which might form the basis for a project - here is one from a discontinued course:
A Bytecode Interpreter and Type Checker for a small stack-based byte code language.
This was a lab from a discontinued 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).
- Conway's game of life. It's too simple and we have seen too many of them.
- Building a web server using some library. There are indeed some cool web server libraries for Haskell, but they don't make for a good project.