460-4144/02 – Practical Functional Programming (PFP)

Gurantor departmentDepartment of Computer ScienceCredits4
Subject guarantorIng. Marek Běhálek, Ph.D.Subject version guarantorIng. Marek Běhálek, Ph.D.
Study levelundergraduate or graduateRequirementOptional
Year1Semesterwinter
Study languageEnglish
Year of introduction2022/2023Year of cancellation
Intended for the facultiesFEIIntended for study typesFollow-up Master
Instruction secured by
LoginNameTuitorTeacher giving lectures
BEH01 Ing. Marek Běhálek, Ph.D.
Extent of instruction for forms of study
Form of studyWay of compl.Extent
Full-time Graded credit 2+2

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. The front part will be implemented in Elm and the back end will be in Haskell. In the project, also other aspects such as the usage of a database or the processing of various data formats will be addressed. 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 languages Haskell and 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.

Teaching methods

Lectures
Tutorials

Summary

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, new pure functional languages like Scala, F# or Clojure emerged and become widely used. Even more, 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 languages Haskell and Elm. As a key 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 this project, it will be demonstrated, that these functional languages are well suited for the development of real-life applications. Moreover, it will be pointed out, that their usage has some key advantages. Beside the programming itself, we will learn how to use some of the key infrastructure and tools supporting the development of real-life applications.

Compulsory literature:

[1] Bryan O'Sullivan, John Goerzen, and Don Stewart. 2008. Real World Haskell (1st. ed.). O'Reilly Media, Inc. Available online: http://book.realworldhaskell.org/ [2] Lipovaca M.:Learn You a Haskell for Great Good!: A Beginner's Guide (1st ed.). No Starch Press, San Francisco, CA, USA, 2011. Available online: http://learnyouahaskell.com/

Recommended literature:

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

Way of continuous check of knowledge in the course of semester

The most important aspect of the evaluation will be the implementation of the project - a web-based information system. It will be divided into smaller parts; each will be evaluated separately. In total, it will be possible to get 70 points for this project. The remaining 30 points will be distributed based on the activity in laboratories.

E-learning

Other requirements

There are no additional requirements for students.

Prerequisities

Subject has no prerequisities.

Co-requisities

Subject has no co-requisities.

Subject syllabus:

Syllabus of presentations Introduction to language Haskell, introduction to functional style of programming. 1. Introduction - Haskell platform, GHCI interpreter, simple recursion, simple functions. 2. Functions - solving more complex problems, basic libraries, introduction to type classes. 3. Lists and user defined data types – basic usage, introduction to list generators, functional way of solving problems . Tools for functional programming 4. Tools for project and library management (Stack, Cabal) and development support tools (eg debugger). 5. Testing Advanced aspects of Haskell programming 6. Programming with actions - theoretical aspects, monads, examples (ST monad). 7. Input and output, handling errors. Selected Haskell libraries 8. Processing of selected data formats (JSON, XML), input parsing. 9. Parallel programming, networking, web REST api. 10. Using the database. 11. Haskell GUI Web GUI in ELM language. 12. Elm - basic components. 13. Elm - selected technologies, application of styles. 14. Elm - connection to the backend in language Haskell. The content of the exercises will be corresponding to the presentations. We assume, that all exercises will be in computer classrooms.

Conditions for subject completion

Full-time form (validity from: 2022/2023 Winter semester)
Task nameType of taskMax. number of points
(act. for subtasks)
Min. number of pointsMax. počet pokusů
Graded credit Graded credit 100  51 3
Mandatory attendence participation: Participation in laboratories is mandatory and is controlled. Students will be informed of the scope of compulsory participation by the course guarantor at the beginning of the semester.

Show history

Conditions for subject completion and attendance at the exercises within ISP: Completion of all mandatory tasks within individually agreed deadlines. The extent of participation in the laboratories is agreed by the student with the course supervisor at the beginning of the semester.

Show history

Occurrence in study plans

Academic yearProgrammeBranch/spec.Spec.ZaměřeníFormStudy language Tut. centreYearWSType of duty
2024/2025 (N0613A140035) Computer Science P English Ostrava 1 Optional study plan
2024/2025 (N0688A140015) Industry 4.0 P English Ostrava 1 Optional study plan
2023/2024 (N0688A140015) Industry 4.0 P English Ostrava 1 Optional study plan
2023/2024 (N0613A140035) Computer Science P English Ostrava 1 Optional study plan
2023/2024 (N2647) Information and Communication Technology (2612T025) Computer Science and Technology P English Ostrava 1 Choice-compulsory study plan
2022/2023 (N0688A140015) Industry 4.0 P English Ostrava 1 Optional study plan
2022/2023 (N0613A140035) Computer Science P English Ostrava 1 Optional study plan
2022/2023 (N2647) Information and Communication Technology (2612T025) Computer Science and Technology P English Ostrava 1 Choice-compulsory study plan

Occurrence in special blocks

Block nameAcademic yearForm of studyStudy language YearWSType of blockBlock owner

Assessment of instruction

Předmět neobsahuje žádné hodnocení.