Functional and Imperative Programming Techniques

Course objectives

General objectives: Acquire functional programming paradigm and advanced aspects of imperative programming in C. Acquire techniques of reasoning about programs, to drive both correctness proofs or program testing. Comparison among different programming language paradigms (imperative, functional, and object--oriented) to speed-up learning of new programming languages. Specific objectives: Knowledge and understanding: Advanced aspects of C language (mainly, explicit pointers and memory (de)allocation, efficiency of C programming). Basic and advanced knowledge of functional programming in Haskell (polymorphic types, laziness, higher-order functions, monads). Apply knowledge and understanding: Apply different programming methodologies (peculiar to each programming paradigm) to problem solving. Critical Judgmental skills: The comparative study of several programming languages paradigm allows students to evaluate, for example, which is the most suitable language to use to develop a given software application. Reasoning about programs techniques can drive both program development and program testing. Communication skills: Students are stimulated, especially in their final presentation to expose concisely but precisely ideas behind programs as well as program analysis. Learning ability: The comparative study of several programming languages paradigm gives students the ability to focus on fondamental aspects of programming languages (parameter passing rules, type systems, language semantics) and this greatly improve their ability to learn new programming languages. Also the ability to learn technical aspects (such as libraries, use of developer tools) will benefit from this studies.

Channel 1
IVANO SALVO Lecturers' profile

Program - Frequency - Exams

Course program
PROGRAM: Part 1: Functional Programming. 1.1) Basic Concepts of Haskell: types, functions, recursive definitions. 1.2) Classes, defining types, higher order functions. 1.3) Call-by-name and lazy evaluation. Dealing with infinite data structures. 1.4) Dealing with non functional aspects (IO, exceptions, state, etc.) in Haskell: Functors, Applicative, and Monads. 1.5) Development of correct programs and program transformation: equational reasoning. Part 2: Imperative Programming. 2.1) Review of basic C programming. 2.2) Storage explicit management in C, alias, side-effects. 2.3) `Functional' programming in C. 2.4) Development of correct programs: logical assertions. Limitations in imperative programming. Part 3: Functional and Imperative Programming Pearls.
Prerequisites
Basic concepts and experience with at least an imperative and/or object oriented programming language (Java, Python, etc.)
Books
R. Bird: "Thinking Functionally with Haskell". Cambridge University Press, 2015. G. Hutton: Programming in Haskell (2nd edition). Cambridge University Press (2016). B.W.Kernigham, D. Ritchie: "The C Programming Language" (2nd edition), Pearson, 1988. Handsouts.
Frequency
Attending lessons is highly recommended.
Exam mode
The exam consists of a written/homework exam and a presentation. The written exam assesses problem solving and programming style acquired. The presentation assesses the ability of presenting a small programming project or a problem and its solution.
Bibliography
E. W. Dijkstra: "A Discipline of Programming", Prentice Hall, 1976. A. Oram, G. Wilson (eds.): "Beautiful Code", O'Reilly, 2008. R. Bird: "Pearls of Functional Algorithm Design", Cambridge University Press, 2010. J. Bentley: "Programming Pearls" (1986) and "More Programming Pearls" (1988), Addison Wesley. R. Bird, P. Wadler: "Introduction to Functional Programming", Prentice Hall (1988).
Lesson mode
Lessons are traditional with slides and blackboard for exercises.
IVANO SALVO Lecturers' profile

Program - Frequency - Exams

Course program
PROGRAM: Part 1: Functional Programming. 1.1) Basic Concepts of Haskell: types, functions, recursive definitions. 1.2) Classes, defining types, higher order functions. 1.3) Call-by-name and lazy evaluation. Dealing with infinite data structures. 1.4) Dealing with non functional aspects (IO, exceptions, state, etc.) in Haskell: Functors, Applicative, and Monads. 1.5) Development of correct programs and program transformation: equational reasoning. Part 2: Imperative Programming. 2.1) Review of basic C programming. 2.2) Storage explicit management in C, alias, side-effects. 2.3) `Functional' programming in C. 2.4) Development of correct programs: logical assertions. Limitations in imperative programming. Part 3: Functional and Imperative Programming Pearls.
Prerequisites
Basic concepts and experience with at least an imperative and/or object oriented programming language (Java, Python, etc.)
Books
R. Bird: "Thinking Functionally with Haskell". Cambridge University Press, 2015. G. Hutton: Programming in Haskell (2nd edition). Cambridge University Press (2016). B.W.Kernigham, D. Ritchie: "The C Programming Language" (2nd edition), Pearson, 1988. Handsouts.
Frequency
Attending lessons is highly recommended.
Exam mode
The exam consists of a written/homework exam and a presentation. The written exam assesses problem solving and programming style acquired. The presentation assesses the ability of presenting a small programming project or a problem and its solution.
Bibliography
E. W. Dijkstra: "A Discipline of Programming", Prentice Hall, 1976. A. Oram, G. Wilson (eds.): "Beautiful Code", O'Reilly, 2008. R. Bird: "Pearls of Functional Algorithm Design", Cambridge University Press, 2010. J. Bentley: "Programming Pearls" (1986) and "More Programming Pearls" (1988), Addison Wesley. R. Bird, P. Wadler: "Introduction to Functional Programming", Prentice Hall (1988).
Lesson mode
Lessons are traditional with slides and blackboard for exercises.
  • Lesson code10589652
  • Academic year2025/2026
  • CourseComputer Science
  • CurriculumMetodologico
  • Year3rd year
  • Semester2nd semester
  • SSDINF/01
  • CFU6