Functional Programming (H) COMPSCI4021
- Academic Session: 2026-27
- School: School of Computing Science
- Credits: 10
- Level: Level 4 (SCQF level 10)
- Typically Offered: Semester 1
- Available to Visiting Students: Yes
- Collaborative Online International Learning: No
- Curriculum For Life: No
Short Description
Functional programming is introduced using Haskell. The standard programming techniques, as well as some advanced topics, are covered and applied to realistic programming problems.
Timetable
3 hours per week: 2x 1 hour lectures, 1x 1 hour lab
Requirements of Entry
None
Excluded Courses
None
Co-requisites
None
Assessment
Examination 60%, Set Exercises 40%.
Set exercises will include a programming project and a class test.
Main Assessment In: April/May
Are reassessment opportunities available for all summative assessments? No
It is the default expectation that all courses will offer opportunities for reassessment or deferred assessment. Where it is not possible to offer this in some assessment components, the grade achieved at the first attempt will be counted towards the final course grade, and any exceptions for this course are described below.
[No exceptions]
Course Aims
Functional programming languages are one of the central focuses of modern research in programming languages, and they are also of immense practical utility. This course presents the concepts of functional programming using Haskell, which is one of the most widely used functional languages. The emphasis is on developing practical programming skills, applying advanced techniques such as monads, parallelism, metaprogramming, and formal methods.
The aims are to understand the principles of functional programming, including functions, expressions, types, type inference, equational reasoning, and monads, and to develop the ability to solve substantial programming problems using Haskell.
Intended Learning Outcomes of Course
By the end of the course students will be able to:
1. Write simple programs involving elementary Haskell techniques, including pure function definitions;
2. Define new algebraic data types and use recursion to define functions that traverse recursive types, and use common higher-order functions such as map, fold, and filter;
3. Demonstrate understanding of how to express data structures and function interfaces using types, and how to infer types;
4. Understand parametric polymorphism, and ad-hoc polymorphism through typeclasses;
5. Demonstrate understanding of the differences between strict and lazy evaluation, and the tradeoffs of the two approaches;
6. Demonstrate understanding of how to structure programs using monads, how to use the most common standard monads (including IO, Maybe, and State), and how to use a monad transformer;
7. Understand and use common functional abstractions such as functors and applicative functors;
8. Develop substantial functional software applications including external libraries;
9. Use formal methods and property-based testing to reason about the correctness of functional programs;
10. Construct, adapt, and analyse code using standard Haskell tools such as Stack and HUnit