Skip to main content

CS256 Functional Programming

CS256 15 CATS (7.5 ECTS) Term 1

Availability

Option - CS, CMS and DM

Prerequisites

Programming: CS118. Mathematics: CS130, CS136, IB104 or IB121

Academic Aims

  • To empower students with a firm foundation in the theory and practise of functional programming (FP).
  • To provide students with a formal framework in which to motivate and develop an understanding of multiple programming language paradigms.

Learning Outcomes

On completion of the module the student should be able to:

  • design and develop substantive FP software in Haskell.
  • to critically consider common features and issues in designing a multi-paradigm programming language such as Python.

Content

  • Language paradigms: imperative, procedural, script, object-orientation, concurrent , declarative, functional, reflective and multi-paradigm.
  • Functional paradigms: mathematics asa programming language, evaluatin expressions strictly (SML) or non-strictly (Haskell).
  • Recursion: control and repetition.
  • Logic: pattern matching, types and λ-calculus in Haskell.
  • Programs as data: methods in Java objects, higher order functions in FP, and reflective programming in Lisp.
  • Consistency for imperative and functional: inefficiency of recursion, impure FP using reference types (SML), pure FP using monads (Haskell).
  • Consistency for functional and object-orientation: FP in Java, multi-paradigm Python.

Books

  • Graham Hutton: Programming in Haskell, CUP, 2007

Assessment

Two pieces of coursework (15%) (25%), 2 hour examination in Term 3 (60%).

Teaching

20 one-hour lectures, 10 Haskell lab sessions