Difference between revisions of "Practical Functional Programming"

From Marek Běhálek Wiki
Jump to navigation Jump to search
 
(13 intermediate revisions by the same user not shown)
Line 37: Line 37:
  
 
[http://linedu.vsb.cz/~beh01/wiki_data/PFP_monads_csharp.pdf Monads in C#]
 
[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]
 +
 +
[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=36 Page 34]
+
* 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=37 Page 35] - [http://linedu.vsb.cz/~beh01/wiki_data/FP_basics.pdf#page=44 Page 42]  
+
* 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=45 Page 43] - [http://linedu.vsb.cz/~beh01/wiki_data/FP_basics.pdf#page=53 Page 51]
+
* 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=54 Page 52] - [http://linedu.vsb.cz/~beh01/wiki_data/FP_basics.pdf#page=65 Page 63]
+
* 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=66 Page 64] - [http://linedu.vsb.cz/~beh01/wiki_data/FP_basics.pdf#page=83 Page 81]
+
* 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_monads.pdf#page=1 Begining] - [http://linedu.vsb.cz/~beh01/wiki_data/PFP_monads.pdf#page=20 Page 18] [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=21 Page 19] - [http://linedu.vsb.cz/~beh01/wiki_data/PFP_monads.pdf#page=42 Page 40]
+
* 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 8: [http://linedu.vsb.cz/~beh01/wiki_data/PFP_monads.pdf#page=43 Page 41] - [http://linedu.vsb.cz/~beh01/wiki_data/PFP_monads.pdf#page=54 Page 54]
+
* Lecture 8: [http://linedu.vsb.cz/~beh01/wiki_data/PFP_monads.pdf#page=21 Page 19] - [http://linedu.vsb.cz/~beh01/wiki_data/PFP_monads.pdf#page=48 Page 46]
* Lecture 9:  
+
* Lecture 9: [http://linedu.vsb.cz/~beh01/wiki_data/PFP_monads.pdf#page=49 Page 47] - [http://linedu.vsb.cz/~beh01/wiki_data/PFP_monads.pdf#page=64 Page 62]
* Lecture 10:  
+
* Lecture 10: [http://linedu.vsb.cz/~beh01/wiki_data/PFP_monads_csharp.pdf Monads in C#]
* Lecture 11:  
+
* Lecture 11: [http://linedu.vsb.cz/~beh01/wiki_data/PFP_conclude.pdf Other topics that should be mentioned]
 
* Lecture 12: No lecture
 
* Lecture 12: No lecture
  
Line 64: Line 68:
 
* [[PFP_Laboratory_9 | Laboratory 9]]
 
* [[PFP_Laboratory_9 | Laboratory 9]]
 
* [[PFP_Laboratory_10 | Laboratory 10]]
 
* [[PFP_Laboratory_10 | Laboratory 10]]
* Credits for the subject given.
+
* [[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 ==
* [[FP_Homework_1 | Homework 1]]
+
* [[PFP_Homework_1 | Homework 1]]
* [[FP_Homework_2 | Homework 2]]
+
* [[PFP_Homework_2 | Homework 2]]
 +
* [[FP_Homework_3 | Homework 3]]
 +
* [[FP_Homework_4 | Homework 4]]
 
* [[PFP_Presentations | Presentation]]
 
* [[PFP_Presentations | Presentation]]
  
 
== 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=53 Page 51]  
+
* 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 81: Line 88:
  
 
=== Tutorial 2 ===  
 
=== Tutorial 2 ===  
* Presentation [http://linedu.vsb.cz/~beh01/wiki_data/FP_basics.pdf#page=54 Page 52] - [http://linedu.vsb.cz/~beh01/wiki_data/FP_basics.pdf#page=83 Page 81]  
+
* 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 87: Line 94:
  
 
=== Tutorial 3 ===  
 
=== Tutorial 3 ===  
* Presentation [http://linedu.vsb.cz/~beh01/wiki_data/PFP_monads.pdf#page=1 Begining] - [http://linedu.vsb.cz/~beh01/wiki_data/PFP_monads.pdf#page=55 Page 52]
+
* 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_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

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.