Difference between revisions of "Practical Functional Programming"
(9 intermediate revisions by the same user not shown) | |||
Line 39: | Line 39: | ||
[http://linedu.vsb.cz/~beh01/wiki_data/PFP_conclude.pdf Other topics that should be mentioned] | [http://linedu.vsb.cz/~beh01/wiki_data/PFP_conclude.pdf Other topics that should be mentioned] | ||
+ | |||
+ | [http://linedu.vsb.cz/~beh01/wiki_data/PFP_denot.pdf Denotační sémantika (in czech only)] | ||
Schedule: | Schedule: | ||
− | * Lecture 1: [http://linedu.vsb.cz/~beh01/wiki_data/FP_basics.pdf#page=1 Beginning] - [http://linedu.vsb.cz/~beh01/wiki_data/FP_basics.pdf#page= | + | * Lecture 1: [http://linedu.vsb.cz/~beh01/wiki_data/FP_basics.pdf#page=1 Beginning] - [http://linedu.vsb.cz/~beh01/wiki_data/FP_basics.pdf#page=21 Page 19] |
− | * Lecture 2: [http://linedu.vsb.cz/~beh01/wiki_data/FP_basics.pdf#page= | + | * Lecture 2: [http://linedu.vsb.cz/~beh01/wiki_data/FP_basics.pdf#page=21 Page 19] - [http://linedu.vsb.cz/~beh01/wiki_data/FP_basics.pdf#page=56 Page 54] |
− | * Lecture 3: [http://linedu.vsb.cz/~beh01/wiki_data/FP_basics.pdf#page= | + | * Lecture 3: [http://linedu.vsb.cz/~beh01/wiki_data/FP_basics.pdf#page=57 Page 55] - [http://linedu.vsb.cz/~beh01/wiki_data/FP_basics.pdf#page=64 Page 62] |
− | * Lecture 4: [http://linedu.vsb.cz/~beh01/wiki_data/FP_basics.pdf#page= | + | * Lecture 4: [http://linedu.vsb.cz/~beh01/wiki_data/FP_basics.pdf#page=65 Page 63] - [http://linedu.vsb.cz/~beh01/wiki_data/FP_basics.pdf#page=85 Page 83] |
− | * Lecture 5: [http://linedu.vsb.cz/~beh01/wiki_data/FP_basics.pdf#page= | + | * Lecture 5: [http://linedu.vsb.cz/~beh01/wiki_data/FP_basics.pdf#page=86 Page 84] - [http://linedu.vsb.cz/~beh01/wiki_data/FP_basics.pdf#page=102 Page 100] |
* Lecture 6: [http://linedu.vsb.cz/~beh01/wiki_data/PFP_tools.pdf Tools for Haskell] | * Lecture 6: [http://linedu.vsb.cz/~beh01/wiki_data/PFP_tools.pdf Tools for Haskell] | ||
* Lecture 7: [http://linedu.vsb.cz/~beh01/wiki_data/PFP_monads.pdf#page=1 Begining] - [http://linedu.vsb.cz/~beh01/wiki_data/PFP_monads.pdf#page=20 Page 18] | * Lecture 7: [http://linedu.vsb.cz/~beh01/wiki_data/PFP_monads.pdf#page=1 Begining] - [http://linedu.vsb.cz/~beh01/wiki_data/PFP_monads.pdf#page=20 Page 18] | ||
Line 66: | Line 68: | ||
* [[PFP_Laboratory_9 | Laboratory 9]] | * [[PFP_Laboratory_9 | Laboratory 9]] | ||
* [[PFP_Laboratory_10 | Laboratory 10]] | * [[PFP_Laboratory_10 | Laboratory 10]] | ||
− | * | + | * [[PFP_Laboratory_11 | Laboratory 11]] |
+ | * Students will have their presentations. | ||
Cheat sheet containing basic functions in [http://linedu.vsb.cz/~beh01/wiki_data/FP_cheatsheet.pdf PDF] | Cheat sheet containing basic functions in [http://linedu.vsb.cz/~beh01/wiki_data/FP_cheatsheet.pdf PDF] | ||
== Homework == | == Homework == | ||
− | * [[ | + | * [[PFP_Homework_1 | Homework 1]] |
− | * [[ | + | * [[PFP_Homework_2 | Homework 2]] |
* [[FP_Homework_3 | Homework 3]] | * [[FP_Homework_3 | Homework 3]] | ||
* [[FP_Homework_4 | Homework 4]] | * [[FP_Homework_4 | Homework 4]] | ||
Line 79: | Line 82: | ||
== Combine study == | == Combine study == | ||
=== Tutorial 1 === | === Tutorial 1 === | ||
− | * Presentation [http://linedu.vsb.cz/~beh01/wiki_data/FP_basics.pdf#page=1 Beginning] - [http://linedu.vsb.cz/~beh01/wiki_data/FP_basics.pdf#page= | + | * Presentation [http://linedu.vsb.cz/~beh01/wiki_data/FP_basics.pdf#page=1 Beginning] - [http://linedu.vsb.cz/~beh01/wiki_data/FP_basics.pdf#page=65 Page 63] |
* [[PFP_Laboratory_1 | Laboratory 1]] | * [[PFP_Laboratory_1 | Laboratory 1]] | ||
* [[PFP_Laboratory_2 | Laboratory 2]] | * [[PFP_Laboratory_2 | Laboratory 2]] | ||
Line 85: | Line 88: | ||
=== Tutorial 2 === | === Tutorial 2 === | ||
− | * Presentation [http://linedu.vsb.cz/~beh01/wiki_data/FP_basics.pdf#page= | + | * Presentation [http://linedu.vsb.cz/~beh01/wiki_data/FP_basics.pdf#page=66 Page 65] - [http://linedu.vsb.cz/~beh01/wiki_data/FP_basics.pdf#page=102 Page 100] |
* [[PFP_Laboratory_4 | Laboratory 4]] | * [[PFP_Laboratory_4 | Laboratory 4]] | ||
* [[PFP_Laboratory_5 | Laboratory 5]] | * [[PFP_Laboratory_5 | Laboratory 5]] | ||
Line 91: | Line 94: | ||
=== Tutorial 3 === | === Tutorial 3 === | ||
− | |||
* Presentation [http://linedu.vsb.cz/~beh01/wiki_data/PFP_monads.pdf Monads in Haskell] [http://linedu.vsb.cz/~beh01/wiki_data/PFP_tools.pdf Tools in Haskell] | * Presentation [http://linedu.vsb.cz/~beh01/wiki_data/PFP_monads.pdf Monads in Haskell] [http://linedu.vsb.cz/~beh01/wiki_data/PFP_tools.pdf Tools in Haskell] | ||
* [[PFP_Laboratory_7 | Laboratory 7]] | * [[PFP_Laboratory_7 | Laboratory 7]] | ||
* [[PFP_Laboratory_8 | Laboratory 8]] | * [[PFP_Laboratory_8 | Laboratory 8]] | ||
* [[PFP_Laboratory_9 | Laboratory 9]] | * [[PFP_Laboratory_9 | Laboratory 9]] | ||
+ | |||
+ | === Tutorial 4 === | ||
+ | * Presentation [http://linedu.vsb.cz/~beh01/wiki_data/PFP_monads_csharp.pdf Monads in C#] [http://linedu.vsb.cz/~beh01/wiki_data/PFP_conclude.pdf Other topics that should be mentioned] | ||
+ | * [[PFP_Laboratory_10 | Laboratory 10]] | ||
+ | * [[PFP_Laboratory_11 | Laboratory 11]] | ||
+ | |||
+ | === Tutorial 5 === | ||
+ | * Students will have their presentations. |
Latest revision as of 12:33, 1 October 2024
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
- Wiki Books: Haskell, for free at: https://en.wikibooks.org/wiki/Haskell
- 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/
- 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/
- Thompson S.: The Haskell: The Craft of Functional Programming (3nd ed.). Addison-Wesley Professional, October 2, 2011, ISBN-10: 0201882957.
- Milewski B.: Category Theory for Programmers, for free at: http://https://bartoszmilewski.com/2014/10/28/category-theory-for-programmers-the-preface/
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:
Basics of functional Programming
Other topics that should be mentioned
Denotační sémantika (in czech only)
Schedule:
- Lecture 1: Beginning - Page 19
- Lecture 2: Page 19 - Page 54
- Lecture 3: Page 55 - Page 62
- Lecture 4: Page 63 - Page 83
- Lecture 5: Page 84 - Page 100
- Lecture 6: Tools for Haskell
- Lecture 7: Begining - Page 18
- Lecture 8: Page 19 - Page 46
- Lecture 9: Page 47 - Page 62
- Lecture 10: Monads in C#
- Lecture 11: Other topics that should be mentioned
- Lecture 12: No lecture
Laboratories
- Laboratory 1
- Laboratory 2
- Laboratory 3
- Laboratory 4
- Laboratory 5
- Laboratory 6
- Laboratory 7
- Laboratory 8
- Laboratory 9
- Laboratory 10
- Laboratory 11
- Students will have their presentations.
Cheat sheet containing basic functions in PDF
Homework
Combine study
Tutorial 1
- Presentation Beginning - Page 63
- Laboratory 1
- Laboratory 2
- Laboratory 3
Tutorial 2
- Presentation Page 65 - Page 100
- Laboratory 4
- Laboratory 5
- Laboratory 6
Tutorial 3
Tutorial 4
Tutorial 5
- Students will have their presentations.