TDA 452
DIT 143
HT 2018

Functional Programming 2018
Welcome

Welcome to Functional Programming 2018 (TDA 452, DIT 143)! The first lecture was on Monday 2018-11-05.

For last-minute updates, questions, discussions, etc, please join the mailing list / discussion group.

Some course election info was presented on April 20, 2017.

Purpose

The course is an introduction to Functional Programming for students who know how to program. The students come mainly from the masters program at Chalmers and the University of Göteborg. See the syllabus for more details.

Please note that you cannot include this course as part of a degree which already contains TDA 555 Introduction to Functional Programming. The contents are too similar (although the exam for this course is more demanding). If you took TDA 555 or similar please consider TDA 342 Advanced Functional Programming.

People

Lectures & Exercises

TimeEdit Schedule

The contents of the lectures is preliminary. There might be minor adjustments or shifts in time.

The videos of the lectures recorded in 2012 & 2011 are still mostly up-to-date.

Monday 13.15 (HB3) Thursday 10.00 (HC3)
Self-study exercises
Week 1 Intro to Haskell.
Extra: Tuples & lists. Types.
Source code: Intro.hs
Tests in GHCi: Intro.txt, Intro.pdf.
Data types.
Source code: DataTypes.hs
Tests in GHCi: DataTypes.txt, DataTypes.pdf.
Getting started with Haskell
Week 2 Working with lists
(recursion, pattern matching)
Source code: WorkingWithLists.hs
Tests in GHCi: WorkingWithLists.txt WorkingWithLists.pdf
08:00 in HA4
Higher Order Functions.
Source code: HigherOrderFunctions.hs
Tests: see comments in source code
2012 Videos: Part 1, Part 2.
Recursion and data types
Week 3 Input/Output.
Source code: countWords.hs, InputOutput.hs, Hangman.hs.
Tests in GHCi: InputOutput.txt
Overloading and Type Classes,
QuickCheck test data generators.
Source code: Overloading.hs, TestDataGenerators.hs.
Tests in GHCi: TC_QC.txt, TC_QC.pdf
Lists and List Comprehensions
Week 4 Recursive data types.
Source code: ArithmeticQuiz.hs, SymbolicExpressions.hs.
Tests in GHCi: RecDataTypes.txt, RecDataTypes.pdf.
Parsing.
Source code: ParsingExamples.hs, Parsing.hs, Parsing library.
Tests in GHCi: Parsing.txt, Parsing.pdf.
IO, Test Data and Properties
Week 5 Monads. (Extra: Instances).
Source code: MonadicEvaluators.hs.
Tests in GHCi: Monadic.txt, Monadic.pdf.

Monads recap.
Lazy · Eager · Parallel.
Source code: Fib.hs, Laziness.hs.
Tests in GHCi: Laziness.txt, Laziness.pdf.
Recursive data types
Week 6 GUI programming
Source code: WebIntro.html, 3pIntro.hs, 3pFudgetsIntro.hs, ThreepennyFudgets.hs.
More info: ThreepennyFudgets.
Tests in GHCi: GUI.txt, GUI.pdf.
Abstract data types.
Type inference examples (from old exams, PreludeFunctions.hs)
Concluding reflections and examples.
Source code: Reverse.hs, Queue.hs, Set.hs.
Tests in GHCi: ADTs.txt, ADTs.pdf.
Week 7 No lectures (Project work!)

Lab Assignments

In the table below you will find links to lab assignments which have to be handed in.

LabPartSubmission deadlineFinal deadline
Lab 1 Wednesday, Week 1
(2018-11-07)
Friday, Week 2
(2018-11-16)
Lab 2 A Wednesday, Week 2
(2018-11-14)
Friday, Week 4
(2018-11-30)
BWednesday, Week 3
(2018-11-21)
Lab 3 AWednesday, Week 4
(2018-11-28)
Friday, Week 6
(2018-12-14)
BWednesday, Week 5
(2018-12-05)
Lab 4 ProposalMonday, Week 6
(2018-12-10)
Thursday, Week 6
(2018-12-13)
Project Wednesday, Week 7
(2018-12-19)
Friday, 2018-12-28?

Note that the deadlines are firm and are controlled strictly by the lab reporting system. Therefore you must submit by the deadlines.

Examination

The examination of the course has two parts: To pass the course it is necessary to pass all assignments and the written exam.

The exam dates are published on the syllabus page in the study portal. At the time of this writing the published exam dates for this course are:

Remember that you have to sign up for the exam ahead of time.

Resources

Please also read the page on how to get help!

Installing Haskell

Haskell Libraries

Help/community/reference info

Old Exams

Books

There is no course textbook. For those who like to follow a textbook I can recommend the following:
Learn You a Haskell for Great Good! by Miran Lipovača

Read it online for free or buy the printed version. Very nice tutorial with humour.

Programming in Haskell by Graham Hutton

2nd edition of a compact and well-written Haskell book that is a good fit for this course. Available as paperback and eBook.

The Craft of Functional programming by Simon Thompson

A more basic book with a slower pace but still covering most of the material in the course. I recommend the 3rd edition which has some coverage of quickCheck (a testing approach used extensively in the course). Also available at the Chalmers bookstore.

Real World Haskell by Bryan O'Sullivan, Don Stewart, and John Goerzen

Also available online. This is more advanced and more oriented towards practical Haskell programming. A good book to have on the shelf if you continue with Haskell. This is the course book for the Advanced Functional Programming course.

Related courses