Functional Programming in OCaml 1000-2M24PFO
OCaml, short for Objective CAML, is a functional programming language that also incorporates elements of object-oriented and imperative paradigms. During the course, we will discuss the key features of functional programming—such as immutable data structures and functions as first-class values—along with semantic constructs commonly found in most functional programming languages, including variant types, pattern matching, type inference, and type abstraction. These features are increasingly making their way into mainstream languages like Java, Python, and C++. We will also explore practical tools used when working with OCaml, including those applied in industrial settings.
List of topics:
1. Introduction to functional programming
2. Basic types and lists, polymorphism
3. Pattern matching
4. Algebraic data types
5. Higher-order functions
6. Modules and functors
7. Elements of imperative programming in OCaml
8. Error handling (exceptions, monads)
9. Objects and classes
10. Polymorphic variants, generalized algebraic data types (GADTs)
Mode
Prerequisites
Prerequisites (description)
Course coordinators
Learning outcomes
Knowledge – the graduate knows and understands:
the theoretical foundations of functional programming … (K_W02)
the functional programming paradigm at a general level … (K_W09)
Skills – the graduate is able to:
write, run, and test programs in the OCaml language (K_U05)
read and understand programs written in OCaml (K_U06)
Social competences – the graduate is prepared to:
- critically evaluate their own knowledge and the content they encounter (K_K01)
- work with respect for intellectual integrity in their own actions and those of others; adhere to the principles of professional ethics, demand the same from others, and care for the achievements and traditions of the computing profession (K_K02)
- recognize the importance of knowledge in solving cognitive and practical problems, search for information in the literature, and seek expert opinions (K_K03)
Assessment criteria
The course assessment is based on small programming tasks assigned in most lab sessions, as well as a final project.
Bibliography
Michael R. Clarkson et al. “OCaml Programming: Correct + Efficient + Beautiful” https://cs3110.github.io/textbook/
John Whitington “OCaml from the Very Beginning”
https://ocaml-book.com/
Anil Madhavapeddy, Yaron Minsky “Real World OCaml: Functional Programming for the Masses” 2nd Edition
https://realworldocaml.org/
Additional information
Additional information (registration calendar, class conductors, localization and schedules of classes), might be available in the USOSweb system: