Results

Log in here for your results.

Timetable

This class runs from weeks 1-5, semester 2, every Wednesday. Lectures are in Graham Hills GH515, Wednesday 11am. Labs run Wednesday 12am-2pm LT1301 and LT1320 Livingstone Tower.

Notes

Notes are here. The notes are typeset using literate Haskell (via lhs2TeX and latex), with source code and commentary in the same file Fffp.lhs, which you can load and run in ghci.

Files

This page is the index for the class code repository. You will need your own copy. On departmental unix machines, you can issue the command

darcs get http://personal.cis.strath.ac.uk/conor.mcbride/FFFP
and you'll acquire your own FFFP directory. Updates to the repository (which happen when I write notes, set assignments or fix mistakes), can be downloaded by issuing the command
darcs pull
if your current directory is FFFP.

Exercise 1

Once you've got hold of the files, change directort to FFFP and issure the command

make ex1
The first time you do this, you should see some compilation happening, and then you should gain access to the little game described in the notes. (I forgot to say, you can add two numbers by pressing + when a sum is in focus.)

Once you've completed all the evaluation exercises, you should receive a "password", and that's the "password" you should fill in on this web page. To reach that page, you'll need to authenticate with your regular DS username and password. When you reach my wee web page, remember to fill in the "password" from exercise 1: don't go telling me your DS password! (Modern life is a confusion of passwords.)

Exercise 2

Exercise 2 involves actual programming. You should find a copy of Ex2.hs (that's a link, just in case) in your FFFP directory, if darcs behaves. You may need to do a darcs pull to update. You can and should edit the file in the editor of your choice. You can access it in ghci by typing

:l Ex2
at the ghci prompt. (That's a lower case L, not a pipe, by the way.) You can then type test expressions and see what happens!

You can upload your Ex2.hs at this web page as many times as you like before the deadline at 11.59pm on Friday 10 February 2012.

A specimen solution is available in Ex2Sol.hs.

Exercise 3

Exercise 3 involves more programming. You should find a copy of Ex3.hs (that's a link, just in case) in your FFFP directory, if darcs behaves. You may need to do a darcs pull to update. You can and should edit the file in the editor of your choice. You can access it in ghci by typing

:l Ex3
at the ghci prompt. (That's a lower case L, not a pipe, by the way.) You can then type test expressions and see what happens!

You can upload your Ex3.hs at this web page as many times as you like before the deadline at 11.59pm on Friday 24 February 2012.

A specimen solution is available in Ex3Sol.hs.

Exercise 4

Exercise 4 involves higher-order programming. You should find a copy of Ex4.hs (that's a link, just in case) in your FFFP directory, if darcs behaves. You may need to do a darcs pull to update. You can and should edit the file in the editor of your choice. You can access it in ghci by typing

:l Ex4
at the ghci prompt. (That's a lower case L, not a pipe, by the way.) You can then type test expressions and see what happens!

You will be able to upload your Ex4.hs at this web page (now active!) as many times as you like before the deadline at 11.59pm on Friday 2 March 2012.

A specimen solution is available in Ex4Sol.hs.

Get Haskell

If you want to get cracking outside of the lab, you may wish to install Haskell on whichever system you happen to use. You could do worse than downloading The Haskell Platform. You'll then need to install darcs, which should be a matter of following simple instructions. Darcs is a distributed revision control system, so you can use it to keep the departmental copy of your FFFP work in sync with any others you may have. By the way, darcs is written in Haskell.

If you're looking for other resources to help you get the hang of Haskell, let me point you at a few free resources out there:

  • the main Haskell Wiki,
  • the excellent and stylish Learn You a Haskell for Great Good! by the magnificent BONUS,
  • the community support available on StackOverflow (but be sure to tag any homework-related questions as homework),
  • the thinnest good introductory textbook about Haskell, Programming in Haskell by Graham Hutton — it ain't free, but the associated slides, videos, code, etc are freely available from his site. (Graham's a good mate of mine, but I don't get a kickback.)