CPSC521: FOUNDATIONS OF FUNCTIONAL PROGRAMMING
(Winter 2024, SA123, TuTh 3:30pm-4:45pm)
Lecturer: Robin Cockett
The purpose of the course is to explore various aspects of
functional programming using Haskell. In particular, the
course provides an introduction to the lambda calculus, abstract
machines, types in programming, type inference, and the role of
these in the implementation of functional programming.
Why functional programming matters ....
- It promotes the view of programming as a mathematical
activity.
- It promotes programming abstractions (generic code).
- It is typed .... Hindley-Milner type inference.
- It allows fast accurate
prototyping for complex programs.
- It has datatypes, classes, monads, and many other goodies.
- It helps you, the programmer, develop a clear view of
programming!
COURSE OUTLINE:
There will be a midterm exam and a final exam. The course
will cover the following topics in roughly this order:
- Revision of/Introduction to data, maps, and folds in Haskell
(3 lectures + assignment)
- Monads, classes, and other topics (3 lectures + assignment)
- Introduction to the lambda calculus (5 lectures)
- Introduction to abstract machines and/or rewriting (2 lectures
+ assignment)
- Type checking and type inference (5 lectures + assignment)
- Strong normalization in the typed lambda calculus (2 lectures)
READING (recommended):
- Benjamin Pierce "Types and Programming Languages" MIT Press.
- Graham Hutton "Programming in Haskell" Cambridge University
Press
- Miran Lipovaca "Learn you a Haskell for the greater good" here.
- Roger Hindley and Jonathan Seldin "Lambda-Calculus and
combinators an introduction".
LECTURE NOTES (as they become available):
ASSIGNMENTS:
- [Due January 26]
Getting going with Haskell (8%) assignment
1 (template file is here with types)
- [Due March 1] Lambda
lifting (14%) assignment
2 (hint: here
is some example code for \alpha renaming lambda expressions).
- [Due March 22]
Abstract machines: lambda calculus reduction (8%) assignment 3.
- [Due April 9]
Type inference for the lambda calculus here (15%).
EXAMS:
- Midterm exam (20%) -- on the 12th March: previous exams --
please note a different order of topics may have been covered --
2020, 2016, 2014,2010, 2009, 2007, 2006 and exercise sheet, 2005 and answers, 2002.
- Final exam (35%), (previous finals 2002, 2006, 2007, and 2008 oral, 2014, 2016).
GRADESCOPE AND ZOOM:
The course will use gradescope for grading assignments and
exams. Students need to sign up at gradescope.ca (press the
"sign up" button). To find the course entry code, go to the
course in D2L and pull down the "content" tab. The zoom links
for the on-line portions of the course will be here.
LAB. NOTES:
Please find the lab. notes here
(Melika Norouzbegi).
HASKELL LINKS:
MONAD
LINKS
LAMBDA CALCULUS AND FUNCTIONAL
PROGRAMMING LINKS:
- Peter Selinger's notes on the lambda calculus.
- Larry Paulson's notes on a
programming approach to the lambda calculus.
- Here are Barendregt's notes
on functional programming and the lambda calculus.
- Here are my notes on the lambda calculus.
COMPUTABILITY LINKS:
- For a proof that the halting problem is undecidable see here.