Skip to main content
Skip header
Terminated in academic year 2022/2023

Functional Programming

Type of study Bachelor
Language of instruction Czech
Code 460-2054/01
Abbreviation FPR
Course title Functional Programming
Credits 3
Coordinating department Department of Computer Science
Course coordinator Ing. Marek Běhálek, Ph.D.

Subject syllabus

List of presentations

Basic introduction to functional programming
1. Course introduction. Introduction to Functional programming. Introduction to programming in the language Haskell (using GHC interpreter).
2. Basic function definition. How to write a simple (recursive) functions in Haskell.
3. Basic data types and how to use them.
4. Defining functions revisited: pattern matching.
5. Lists and tuples - a basic notation, how to use them in programs.
6. Working with list.
7. Introduction of higher-order functions. Functions as a first-class value. Functions map - fold.
8. List comprehensions, list generators.
9. User defined data types and how to work with them.
10. Recursive data types and polymorphism, a partial function evaluation, basic introduction to type classes.
11. Abstract data types (list, queue, tree).

Advanced topics
11. Introduction to lambda calculus, computation as rewriting, lazy evaluation.
13. Input and output.
14. Programing language Elm.

List of laboratories (it is expected, that all laboratories will be in a computer laboratories)
1. GHC Interpreter - basic usage
2. Implementation of basic functions computing for example: factorial, Fibonacci sequence, or the greatest common divisor.
3. Functions and operators that work with numbers, strings or characters.
4. Implementation of more complex functions that uses pattern matching, guard expressions etc.
5. - 6. Implementation of functions that work with lists like: length, reverse, (++), zip, zipWith.
7. Usage of standard functions working with lists like map, fold, concat etc.
8. List generators.
9. Evaluation of first project.
10. Definition of a data type for mathematical expressions. Evaluation of such expressions.
11. Definition of a binary tree. Implementation of a functions that work with such a tree.
12. Implementation of abstract data types - stack and queue.
13. Input and output in Haskell - writing to standard output, reading a file.
14. Evaluation of the second project.

Literature

O'Sullivan B., Goerzen J., Stewart D.: Real world Haskell, O'Reilly Media, Inc. 2008. ISBN:0596514980  - for free at: http://book.realworldhaskell.org/read/

Advised literature

Thompson S.: The Haskell: The Craft of Functional Programming (3nd ed.). Addison-Wesley Professional, October 2, 2011, ISBN-10: 0201882957 .

Lipovaca M.:Learn You a Haskell for Great Good!: A Beginner's Guide (1st ed.). No Starch Press, San Francisco, CA, USA, 2011 - for free at: http://learnyouahaskell.com/