
Writing programs by solving equations for unknown functions.
Standard functions as instances of folds. The take lemma, induction on finite lists, induction on infinite lists.
Sudoku solver as an example the idea of infeasibly inefficient algorithms.Sorting as an example the concept of efficiency of evaluation, and the asymptotic complexity of a calculation. Evaluation as computation, evaluation order recursive definitions, non-termination and an outline of the idea of computability.Lists, finite and infinite lists list comprehensions, standard list functions including map, filter, concat. Parametric polymorphism, type classes and ad-hoc polymorphism recursive types.
Basic types, constructed types (sums and products) constructors, selectors, and discriminators definitions by pattern matching. Mathematical functions as programs, function application as program execution lists for sequencing, and function composition as a program structuring tool. Function definitions in Haskell scripts, interactive sessions.
Programming by writing functions: expressions, values, types, evaluation. Reason about the time and space complexity of programs. Use polymorphism and higher-order functions. Reason formally about functional programs. Learning outcomesĪt the end of the course the student will be able to: The course provides hands-on experience of programming through two lab exercises: the first one aims to make you acquainted with the mechanics of writing Haskell programs, and the second one tackles a more challenging programming task. This makes the language very powerful, so that we can easily construct programs that would be difficult or very large in other languages.Īn important theme of the course is how to apply mathematical reasoning to programs, so as to prove that a program performs its task correctly, or to derive it by algebraic manipulation from a simpler but less efficient program for the same problem. It makes use of a programming language called Haskell, in which programs can be viewed as mathematical functions. The lectures will be supported by discussion sessions live on Teams. The lectures for this course will be pre-recorded and available on Panopto (click Recorded Lectures>2021-22>Functional Programming).
Preliminary Examinations - Mathematics and Computer Science Preliminary Examinations - Computer Science Preliminary Examinations - Computer Science and Philosophy