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

Functional Programming 2023/24 fall

  • Üldinfo
    • Õppekorraldus
  • Loeng
    • Baasväärtused ja tüübid
    • 𝜆-arvutus
    • Kõrgemat järku funktsioonid
    • Interaktiivne programmeerimine
    • Uute tüüpide loomine
    • Liidesed
    • Sisend-Väljund
    • Laiskus
    • Lihtsalt tüübitud 𝜆-arvutus
    • Tüübituletus
    • Sõltuvad tüübid
    • Tõestamine Idrises
    • Kvantitatiivne tüübiteooria
  • Praktikum
    • KKK
    • Installimine
    • Kodutöö 1
    • Kodutöö 2
    • Kodutöö 3
    • Kodutöö 4
    • Kodutöö 5
    • Kodutöö 6
    • Kodutöö 7
    • Kodutöö 8
    • Kodutöö 9
    • Kodutöö 10
    • Kodutöö 11
    • Kodutöö 12
    • Kordamine
    • Projektid
  • Moodle
  • Zulip (sisselogides näed linki)

Korduma kippuvad küsimused

1. Miks mitte Haskell?

Tahame rääkida teemadest, mida Haskell otse ei võimalda: sõltuvad tüübid, tõestamine, kvant. tüübiteooria. Lisaks, on tekkinud kahtlus, et laisk väärtustamine pole kõikideks kasutusjuhtudeks sobivaim.

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