AFP image

Haskell Resources:
School of Computer Science
University of Nottingham
Jubilee Campus, Wollaton Road
Nottingham NG8 1BB, UK

T: +44(0) 115 9514251
F: +44(0) 115 9514254

HMU cover

Advanced Functional Programming teaches powerful language constructs, programming techniques, and exciting applications of Haskell. Functional languages represent the leading edge of programming language design, and the primary setting in which new programming concepts are introduced and studied. This module builds upon the introductory module G51FUN Functional Programming, by focussing on a number of more advanced topics in functional programming, including aspects of recent and current research. The precise topics covered will vary from year to year, but will include topics such as programming with effects, reasoning about programs, improving efficiency, infinite data structures, and functional pearls.

Learning Material

The best introduction to Haskell is the book by Graham Hutton, Programming in Haskell. You already used it in the first year module G51FUN. It is important that you reread it before starting G52AFP.

The new material, expecially about functors, applicatives, and monads, is delivered on the whiteboard during the lectures. You must take your own hand-written notes; these will be the main study resourse for you. I will provide some notes and some code on this page from time to time.

Outline of lectures

In this section you will find, after each lecture, a list of topics that were taught and sometimes links to lecture material.

1. 25 Jan 2016 Introduction: What AFP is about
Review of Haskell
Introduction to AFP slides
Haskell review slides
2. 26 Jan 2016 Review of Haskell:
Functions, Lists, Recursion, Types
Graham Hutton: Haskell Prelude
3. 1 Feb 2016 Sudoku:
Game representation, valid grids
Haskell code and comments
4. 2 Feb 2016 Sudoku:
Simple solver, first improvement
5. 8 Feb 2016 Sudoku:
Advanced solvers
6. 9 Feb 2016 Review of type classes
7. 15 Feb 2016 Instances of functors
Maybe, Lists, Trees
Monads and More
Handout in Lecture
8. 16 Feb 2016 IO as a functor
Functor Laws, Streams
9. 22 Feb 2016 Applicative Functors
Maybe, Lists, Trees are applicatives
Examples of (Applicative) Functors
10. 23 Feb 2016 IO is applicative
Applicative Laws
11. 29 Feb 2016 Monads
The bind and do notations
12. 1 Mar 2016 The State Monad ...
13. 7 Mar 2016 Review of the State Monad
Relabeling Trees
14. 8 Mar 2016 Relabeling Trees (cont.)
Explanation of Coursework 2
15. 18 April 2016 Coursework 2: Imperative programs
and stack machine code
16. 19 April 2016 Coursework 2 bonus exercise:
The Writer monad transformer
17. 25 April 2016 Streams ...
18. 26 April 2016 Streams (continuation)
Exam topics

Coursework and Feedback

The coursework for the module comprises two extended programming exercises, and will be released here at the appropriate points during the module. Be sure to read carefully the regulations about plagiarism in the student handbook.

The first coursework will count for 10% of your final mark and the second coursework for 15%. Coursework is marked not only on its correctness, but also on efficiency and clarity of the code.

On the Moodle page there is a forum. You can use it to ask for feedback on any topic from the lectures and on the coursework.

8 February 8 March Noughts and Crosses
Initial Code
Implementing games
Game Trees
8 March 26 April Monadic Compiler
Initial Code
The State Monad

Contacting the teacher

If you don't understand something or have any issues with the topics, don't be shy and ask. The first place to look for answers to questions about the module is the AFP forum on Moodle.

I will have office hours on Monday from 4 to 5 PM and Tuesday from 10 to 11 AM. My office is B83 in the Computer Science Building. You can come and ask any question about the material explained in the lectures.

You can contact me by e-mail: put G52AFP in the subject line, so I know immediately that it is about this module.