Practical Functional Programming

From Marek Běhálek Wiki
Jump to navigation Jump to search

Basic introduction

Functional style of programming is well established, but for decades it was mostly used in universities and frequently it was treated like a nice concept without real practical application. Pure functional languages like Haskell, were rarely used for real life applications. Right now, functional style of programing is going through a sort of renaissance. It is embedded into many of the most popular multiparadigm languages like Python, Javascript or C#. Moreover, with the usage of JVM (Scala) or .NET CLR (F#) it is even easier to have a project accommodating various styles of programming. In this subject, we will focus on practical aspects of applications development using pure functional programming language Haskell (maybe also Elm) and on the application of principles of functional programming in other languages. Beside the programming itself, we will learn how to use some of the key infrastructure and tools supporting the development of real-life applications.

Subject aims expressed by acquired skills and competences

The aim of the course is to show the practical use of purely functional programming languages for the development of real-life applications. As a key project, a web-based information system will be implemented. In addition to pure functional programming languages and the related functional style of programming itself, students will also learn selected tools and a programming environment, that is necessary to build more complex applications.

After completing the course, participants will be able to practically apply a functional style of programming to solve real-life problems. They will be able to evaluate, if it is suitable to use it in given context and what advantages or disadvantages such approach will bring. They will get acquainted in more detail with the programming language Haskell and (probably) Elm (both are syntactically very similar). They will also learn more about the functional style of programming, which can be useful also in other technologies than for purely functional programming languages. Most of today's dominant technologies support many programming paradigms and it is more a choice of the programmer, which style will be used in the solution. The course enables you to use the functional style of programming in many aspects regardless of the used environment.

Recommended literature

Way of continuous check of knowledge in the course of semester

During the exercises, students will be programming assigned tasks. The results of these tasks will be the crucial part of the final evaluation. Additionally, a project we will create a web-based information system, where the front end will be implemented in Elm and the back end will be in Haskell. They will be connected through REST Api. Moreover, we will address other issues as the usage of database or parsing various data formats.

On these tasks, it will be demonstrated, that these functional languages are well suited for the development of real-life applications.

Software

In our lectures, we will be using [1] with Visual Studio Code. For VS Code, we will be using an extension:

Presentations

Presentations used in our lectures:

Introduction to PFP

Basics of functional Programming

Monads in Haskell

Tools for Haskell

Monads in C#

Other topics that should be mentioned

Denotační sémantika (in czech only)

Schedule:

Laboratories

Cheat sheet containing basic functions in PDF

Homework

Combine study

Tutorial 1

Tutorial 2

Tutorial 3

Tutorial 4

Tutorial 5

  • Students will have their presentations.