COM2108 Functional Programming
|| This module introduces the principles of functional programming, using the Haskell programming language. It introduces types and classes, function
definitions, list comprehension, recursive and higher order functions, eager and lazy evaluation, and basic data types.
- Timed in-semester assessments for threshold assessment. These assessments will assess the learning outcomes to a threshold (pass) level only.
- An assignment, including a programming component and written report. This assignment will assess the module learning outcomes beyond the bare pass level.
|| Dr Emma Norling
This unit aims to:
- Present the principles of functional programming;
- Enhance student’s knowledge of recursion and recursive function design;
- Introduce concepts of pattern matching, lazy evaluation, partial application and higher order functions;
- Outline higher-level topics in functional programming.
By the end of the unit, a candidate will be able to:
- explain the functional model of programming;
- design and implement recursive functions using base and recursive cases;
- demonstrate the use of partial and higher-order function application techniques;
- design and implement solutions to real world problems using a functional paradigm.
Basic functional programming and Haskell
- Introduction to functional programming: functions, parameters, arguments, binding, environments and types;
- Built-in types such as Integers, Reals and Lists;
- Recursive function definitions: tail recursion and general recursion;
- Function definition using multiple equations, patterns and guards;
- Anonymous functions.
Further topics in functional programming:
- Higher order functions;
- Function composition;
- User-defined data structures and type classes;
- Algebraic data types
Advanced functional programming:
- Top-down design and bottom-up implementation of functional programs;
- Partial function application
- Lazy Programming
- The IO Monad
- Design Patterns in functional programming
||Not available to students who have taken COM2001.
- Teaching will consist of approximately 20 hours of lecture material, supported by approximately 20 hours of practical classes.
||Feedback is available on a weekly basis in scheduled practical classes. Feedback for in-class tests and programming assignments will be available via Blackboard.
- Graham Hutton, "Programming in Haskell", Cambridge University Press, Second Edition, 2016.
- Bryan O'Sullivan, Don Stewart and John Goerzen, "Real World Haskell", O'Reilly Media, 2008. Free online access to full text at http://book.realworldhaskell.org/
- Simon Thompson, "Haskell: The Craft of Functional Programming", (Second Edition). Addison- Wesley, 1999.