Functional Programming (H) COMPSCI4021
- Academic Session: 2024-25
- 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
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
Reassessments are normally available for all courses, except those which contribute to the Honours classification. For non Honours courses, students are offered reassessment in all or any of the components of assessment if the satisfactory (threshold) grade for the overall course is not achieved at the first attempt. This is normally grade D3 for undergraduate students and grade C3 for postgraduate students. Exceptionally it may not be possible to offer reassessment of some coursework items, in which case the mark achieved at the first attempt will be counted towards the final course grade. Any such exceptions for this course are described below.
Resit examinations ARE NOT ALLOWED for Honours students.
Resit examinations ARE ALLOWED for Masters students.
The coursework cannot be redone because it is impossible to generate an equivalent piece of coursework which replicates the original one because of the follow-up work which was done subsequent to the original submission. Feedback provided to the students after the original coursework would give any student redoing coursework an unfair advantage.
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
Minimum Requirement for Award of Credits
Students must submit at least 75% by weight of the components (including examinations) of the course's summative assessment.