Welcome to the webpage for The University of Strathclyde CS316 "Functional Programming"!
This course has a Twitter account.
Assessment: this course is entirely assessed by coursework. There are four exercises that you will complete (details below). For the 2nd, 3rd, and 4th exercises, you will do two thirds of the exercise at home or in the labs, and the final third is done in exam conditions in the lab.
See the schedule.
Bob Atkey LT1305 robert.atkey@strath.ac.uk
Fredrik Nordvall Forsberg LT1310 fredrik.nordvall-forsberg@strath.ac.uk
Lectures are at 11am Mondays in GH816 and 11am Fridays in LT210. In week one, there was an additional lecture on Thursday at 4pm in LT210 in place of the tutorial normally in that slot.
See the schedule for more details.
Most of the lectures will involve us doing live coding. We will place the code from each lecture in this repository after each lecture, interspersed with commentary covering what we talked about.
- Lecture 1 (with notes) : Data and Pattern Matching
- Lecture 2 (notes in progress) : Standard types and classes. The GHCi trace of the lecture.
- Lecture 3 (with notes) : Defining functions
- Lecture 4 (with notes) : List comprehensions
- Lecture 5 (with notes) : Recursive functions
- Lecture 6 (with notes) : Higher-order functions
- Lecture 7 (notes in progress) : Declaring types and classes
- Lecture 8 (notes in progress) : QuickCheck
- Lecture 9 (with notes) : Recursion Schemes
- Lecture 10 (with notes) : Functors and Containers
- Lecture 11 (with notes) : Building Pure Evaluators
- Lecture 12 (with notes) : Monads and Applicatives
- Lecture 13 (with notes) : Monads we Like
- Lecture 14 (with notes) : Parser Combinators
- Lecture 15 (with preliminary notes) : More Parser Combinators
- Lecture 16 (with notes) : Parsing expressions, and Writer and State Monads
- Lecture 17 (with preliminary notes) : Traversing Containers
- Lecture 18 (with notes) : Interaction
- Lecture 19 (with notes) : Infinite Data and Processes
- Lecture 20 (notes in progress) : Parallelism
- Lecture 21 (notes in progress) : Concurrency
- Lecture 22 : A look at Agda (CS410 propaganda)
In addition to the lectures, there are weekly tutorials at 4pm on Thursdays in LT210. These are intended for going through some unassessed homework questions that we will set after the lectures, or for you to ask questions about the assessed exercises.
- Tutorial 1: Unveiling of Exercise 2 (FOP).
- Tutorial 2: Questions about Exercise 2, and working through some unassessed homework questions.
- Tutorial 3: Unveiling of Exercise 3 (HOP).
- Tutorial 4: Retrospective on Exercise 2 (FOP).
- Tutorial 5: Questions about Exercise 3, and working through some unassessed homework questions.
- Tutorial 6: Unveiling of Exercise 4 (GHOUL). See also some notes on Ex3.
- Tutorial 7: Retrospective on Exercise 3 (HOP), and more on parsing expressions.
- Tutorial 8: Questions about Exercise 4 (GHOUL), and working through some unassessed homework questions.
- Tutorial 9: Questions about Exercise 4 (GHOUL), and some more information examples of evaluators with different kinds of effects.
At every lecture and tutorial, we will hand out "One minute papers" (OMPs) for you to provide us with feedback on the lecture -- what you have learned in this lecture and what we could have explained better. At the start of the next lecture, we will go through the OMPs from last time and try to address the feedback you give us.
Students registered on the course can see their OMPs on the Marx system.
As detailed above, this course is entirely assessed by coursework. The split between the four exercises is shown below:
-
Exercise 1 (5%) : The evaluation game. Once you have finished, enter your username and you will get a password. Email this to one of us (email addresses below) by the deadline (Thursday 28th September, 4pm).
-
Exercise 2 (30%) : First-order Programming (FOP). This will be released on Thursday 28th September (week 2), and the final deadline and test are on Monday 16th October (week 5).
-
Exercise 3 (30%) : Higher-order Programming (HOP). This will be released on Thursday 12th October (week 4), and the final deadline and test are on Monday 6th November (week 8).
-
Exercise 4 (35%) : GHOUL. This will be released on Thursday 2nd November (week 7), and the final deadline and test are on Monday 27th November (week 11).
After each of the exercises has been marked, we will email you your marks, and also put them on the Marx system for you to see.
To clone a local copy of this git repository, execute
git clone https://github.com/bobatkey/CS316-17/
Then cd CS316-17
and execute
./set-up-gitlab.sh
to set up syncing with your personal Gitlab account. (Update: This script should now also work on your personal computer. Please ask us (in person or by email) if you want help setting things up.)
After running the script, you can pull updates from Github by executing
git pull
in the directory CS316-17
from above. To push your changes to gitlab (e.g. for assessment), first commit them
git commit -a -m "<commit message>"
then do
git push gitlab
on the command line. Enjoy!
- What is a Monad? - Computerphile. Graham Hutton (author of the programming in Haskell book linked below) explains Monads.
- A History of Haskell: Being Lazy With Class is an account of the history of the Haskell language and how it got it's name.
These links are to lecture courses by other Universities and companies. You might find them useful as alternative presentations of the material in our course.
-
Glasgow uni (free!) MOOC on Functional programming in Haskell.
-
Video lectures by Erik Meijer on Functional Programming Fundamentals.
-
Material from CIS 194: Introduction to Haskell at the University of Pennsylvania.
There are now many books written about Haskell. Here are links to some that we have found useful.
-
Programming in Haskell is the book that we have based the first half of this course on. You do not need to buy the book.
-
The Haskell Wikibook. This is a free online book that starts very gently, but also includes some very advanced material.
-
Parallel and Concurrent Programming in Haskell by Simon Marlow. This book is an excellent description of the facilities in Haskell for parallel and concurrent programming. We will cover some of these in Lectures 20 and 21. The full text is available online for free reading.
-
Learn You a Haskell for Great Good!. This is an introductory book on Haskell, covering roughly the same material as this course, but with a different presentation. There are attempts at humour, but you might find them grating after a while. The full text of this book is available online for free.