CM20256: Functional programming
[Page last updated: 27 October 2020]
Academic Year:  2020/1 
Owning Department/School:  Department of Computer Science 
Credits:  6 [equivalent to 12 CATS credits] 
Notional Study Hours:  120 
Level:  Intermediate (FHEQ level 5) 
Period: 
 Semester 2

Assessment Summary:  CW 50%, EX 50% 
Assessment Detail: 
 Coursework (CW 50%)
 Exam (EX 50%)

Supplementary Assessment: 
 Likeforlike reassessment (where allowed by programme regulations)

Requisites: 
Before taking this module you must take CM10228 OR take XX10190

Description:  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.
Learning Outcomes: On completion of this unit, students will be able to:
1. Define and explain the syntax and semantics of the lambdacalculus, and its role as a model of computation.
2. Demonstrate the difference between reduction orders and explain their relationship with callbyname, callbyvalue and callbyneed evaluation.
3. Define and explain the simplytyped lambda calculus, HindleyMilner polymorphism, and type inference.
4. Write programs over structured datatypes in a typed higherorder 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 lambdacalculus: Church numerals and operations (addition, subtraction, multiplication), Booleans, recursion via fixed points. The diamond property. ChurchRosser theorem.
Typed lambda calculus. HindleyMilner polymorphism and type checking and type inference.
Programming in a typed higherorder functional programming language (e.g. Haskell.) Types and type constructors: product, sum and function types. Recursive types, especially lists. Programming with map and fold. Callbyname, callbyvalue and callbyneed; graph reduction. Relationship of functional programming to other programming styles; integration of effects in functional programming languages. 
Programme availability: 
CM20256 is Compulsory on the following programmes:
Department of Computer Science
 USCMAFB06 : BSc(Hons) Computer Science (Year 2)
 USCMAAB07 : BSc(Hons) Computer Science with Study year abroad (Year 2)
 USCMAKB07 : BSc(Hons) Computer Science with Year long work placement (Year 2)
 USCMAFB20 : BSc(Hons) Computer Science and Mathematics (Year 2)
 USCMAAB20 : BSc(Hons) Computer Science and Mathematics with Study year abroad (Year 2)
 USCMAKB20 : BSc(Hons) Computer Science and Mathematics with Year long work placement (Year 2)
 USCMAFM01 : MComp(Hons) Computer Science (Year 2)
 USCMAAM02 : MComp(Hons) Computer Science with Study year abroad (Year 2)
 USCMAKM02 : MComp(Hons) Computer Science with Year long work placement (Year 2)
 USCMAFM14 : MComp(Hons) Computer Science and Mathematics (Year 2)
 USCMAAM14 : MComp(Hons) Computer Science and Mathematics with Study year abroad (Year 2)
 USCMAKM14 : MComp(Hons) Computer Science and Mathematics with Year long work placement (Year 2)
CM20256 is Optional on the following programmes:
Department of Mathematical Sciences
 USMAAFB15 : BSc(Hons) Mathematical Sciences (Year 2)
 USMAAFB15 : BSc(Hons) Mathematical Sciences (Year 3)
 USMAAAB16 : BSc(Hons) Mathematical Sciences with Study year abroad (Year 2)
 USMAAAB16 : BSc(Hons) Mathematical Sciences with Study year abroad (Year 4)
 USMAAKB16 : BSc(Hons) Mathematical Sciences with Year long work placement (Year 2)
 USMAAKB16 : BSc(Hons) Mathematical Sciences with Year long work placement (Year 4)
 USMAAFB13 : BSc(Hons) Mathematics (Year 2)
 USMAAFB13 : BSc(Hons) Mathematics (Year 3)
 USMAAAB14 : BSc(Hons) Mathematics with Study year abroad (Year 2)
 USMAAAB14 : BSc(Hons) Mathematics with Study year abroad (Year 4)
 USMAAKB14 : BSc(Hons) Mathematics with Year long work placement (Year 2)
 USMAAKB14 : BSc(Hons) Mathematics with Year long work placement (Year 4)
 USMAAFB01 : BSc(Hons) Mathematics and Statistics (Year 3)
 USMAAAB02 : BSc(Hons) Mathematics and Statistics with Study year abroad (Year 4)
 USMAAKB02 : BSc(Hons) Mathematics and Statistics with Year long work placement (Year 4)
 USMAAFB05 : BSc(Hons) Statistics (Year 2)
 USMAAFB05 : BSc(Hons) Statistics (Year 3)
 USMAAAB06 : BSc(Hons) Statistics with Study year abroad (Year 2)
 USMAAAB06 : BSc(Hons) Statistics with Study year abroad (Year 4)
 USMAAKB06 : BSc(Hons) Statistics with Year long work placement (Year 2)
 USMAAKB06 : BSc(Hons) Statistics with Year long work placement (Year 4)
 USMAAFM14 : MMath(Hons) Mathematics (Year 2)
 USMAAFM14 : MMath(Hons) Mathematics (Year 3)
 USMAAAM15 : MMath(Hons) Mathematics with Study year abroad (Year 2)
 USMAAKM15 : MMath(Hons) Mathematics with Year long work placement (Year 2)
 USMAAKM15 : MMath(Hons) Mathematics with Year long work placement (Year 4)

Notes:  This unit catalogue is applicable for the 2020/21 academic year only. Students continuing their studies into 2021/22 and beyond should not assume that this unit will be available in future years in the format displayed here for 2020/21.
 Programmes 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 prerequisite rules.
 Find out more about these and other important University terms and conditions here.
