Institute of Computer Science
  1. Courses
  2. 2025/26 fall
  3. Functional Programming (LTAT.03.019)
ET
Log in

Functional Programming 2025/26 fall

  • Üldinfo
    • Õppekorraldus
  • Kursus
    • KKK
    • Installimine
    • Kodutöö 1
    • Kodutöö 2
    • Kodutöö 3
    • Kodutöö 4
    • Kodutöö 5
    • Kodutöö 6
    • Kodutöö 7
    • Kodutöö 8
    • Suur kodutöö 1
    • Kodutöö 9
    • Kodutöö 10
    • Kodutöö 11
    • Kodutöö 12
    • Suur kodutöö 2
    • Kodutöö 13*
    • Kodutöö 14*
  • FP Õpik
  • Moodle
  • Zulip (sisselogides näed linki)

Korduma kippuvad küsimused

1. Miks mitte Haskell?

Esiteks, tahame rääkida teemadest, mida Haskell otse ei võimalda: sõltuvad tüübid, tõestamine, kvant. tüübiteooria. Haskellis on see palju tülikam.

Teiseks, üksgi programeerimiskeel ei kata kõiki huvitavaid aspekte. Haskelli laisk väärtustamine pole kõikideks kasutusjuhtudeks sobivaim. Lean-i ja Coq-iga saab paremini teha tõestusi. Ocaml-is, Swift-is, Python-is jne. saab mugavamalt praktiliselt programmeerida. Pigem olge avatud kasutama erinevaid keeli vastavalt vajadusele.

Kolmandaks, me ei jõua ühe kursuse raames Haskelli (ega ühtegi teist keelst) korralikult selgeks õpetada. Idris 2 on selgelt akadeemiline keel, kus keegi ei pahanda, et me kogu Idrist selgeks ei saa.

2. Miks ei saa võrrelda Leaf == Leaf või [] == []?

Sest Idris ei tea, mis on Leaf tüüp: kas see on Tree Int või Tree String või hoopis midagi kolmandat.

Võrrelda saame, kui kasutame tüübiannotatsiooni võtmesõnaga the:

Main> the (List Int) [] == the (List Int) []
True
Main> the (Tree Char) Leaf == the (Tree Char) Leaf
True

või kui defineerime kaks muutujat, millele määrame tüübi:

data Tree a = Leaf | Branch (Tree a) a (Tree a)

a : Tree String
a = Leaf

b : Tree String
b = Leaf
Main> a == b
True
  • Institute of Computer Science
  • Faculty of Science and Technology
  • University of Tartu
In case of technical problems or questions write to:

Contact the course organizers with the organizational and course content questions.
The proprietary copyrights of educational materials belong to the University of Tartu. The use of educational materials is permitted for the purposes and under the conditions provided for in the copyright law for the free use of a work. When using educational materials, the user is obligated to give credit to the author of the educational materials.
The use of educational materials for other purposes is allowed only with the prior written consent of the University of Tartu.
Terms of use for the Courses environment