## CM50262: Functional programming

[Page last updated: 23 October 2023]

Owning Department/School: Department of Computer Science
Credits: 6 [equivalent to 12 CATS credits]
Notional Study Hours: 120
Level: Masters UG & PG (FHEQ level 7)
Period:
Semester 2
Assessment Summary: CW 25%, EXCB 75%
Assessment Detail:
• Coursework (CW 25%)
• Exam (EXCB 75%)
Supplementary Assessment:
Like-for-like reassessment (where allowed by programme regulations)
Requisites: Before taking this module you must take CM50258 OR take CM50109 OR take another programming module
Learning Outcomes: On completion of this unit, students will be able to:
1. Define and explain the syntax and semantics of the lambda-calculus, and its role as a model of computation.
2. Demonstrate the difference between reduction orders and explain their relationship with call-by-name, call-by-value and call-by-need evaluation.
3. Define and explain the simply-typed lambda calculus, Hindley-Milner polymorphism, and type inference.
4. Write programs over structured datatypes in a typed higher-order functional programming language.
5. Formally reason about and proof properties of functional programs using the formalism of the typed lambda-calculus.

Aims: To illustrate how the logical and semantic foundations of programming languages are translated into usable programming languages. To give students practical experience of using a functional programming language.

Skills: Use of IT (T/F,A), Problem Solving (T/F,A)

Content: The lambda calculus, syntax and semantics; free and bound variables; alpha conversion; beta and eta reduction. Normal form subject to a reduction scheme. Reduction order: normal and applicative; Y combinator. Programming in the lambda-calculus: Church numerals and operations (addition, subtraction, multiplication), Booleans, recursion via fixed points. The diamond property. Church-Rosser theorem.
Typed lambda calculus. Hindley-Milner polymorphism and type checking and type inference.
Programming in a typed higher-order functional programming language (e.g. Haskell.) Types and type constructors: product, sum and function types. Recursive types, especially lists. Programming with map and fold. Call-by-name, call-by-value and call-by-need; graph reduction. Relationship of functional programming to other programming styles; integration of effects in functional programming languages.

Course availability:

#### CM50262 is Compulsory on the following courses:

Department of Computer Science

 Notes: This unit catalogue is applicable for the 2023/24 academic year only. Students continuing their studies into 2024/25 and beyond should not assume that this unit will be available in future years in the format displayed here for 2023/24. Courses and units are subject to change in accordance with normal University procedures. Availability of units will be subject to constraints such as staff availability, minimum and maximum group sizes, and timetabling factors as well as a student's ability to meet any pre-requisite rules. Find out more about these and other important University terms and conditions here.