Tentative plan for 02157 Functional Programming (Autumn 2017)

Teacher: Michael R. Hansen.

Textbook: Functional Programming using F#, Michael R. Hansen and Hans Rischel, Cambridge University Press, 2013. (Abbreviated HR.)

Week Date Topic Read Exercises
36   8. Sept. Course introduction
Introduction to functional programming and F#
Lists (brief introduction)
Lecture1.pdf, Lecture1Handout.pdf
HR 1
HR 2.1-2.6
HR 4.1-4.3
Exercises
37   15. Sept. Functions, Basic types and Tuples
Lists, Types, Polymorphism
Lecture2.pdf, Lecture2Handout.pdf
HR 2, HR 3.1-3.3, HR 4.1 - 4.4
  1. HR 2.1, 2.2, 4.3, 4.8, 4.9, 4.12, 4.11
  2. Merge sort. A program to generate random lists is here
38 22. Sept. Company presentations Exercises that are based on old exam questions
39 29. Sept. Programming as a model-based activity
Lecture4.pdf, Lecture4Handout.pdf
HR 3.4-3.7, HR 4 HR 4.17, 4.19, 4.20, 4.23, 4.18

The first mandatory assignment will be released in CampusNet this Friday at 11:30.
It should be submitted under Assignments in CampusNet on Thursday, Oct. 5, 2017.
40 6. Oct. Disjoint union (Tagged values)
Higher-order list functions
Lecture5.pdf, Lecture5Handout.pdf
HR 3.8-3.11
HR 5.1
  1. HR 3.5
  2. HR 5.2, 5.3, 5.5
  3. Make a revised version of the Cash register example in Section 4.6 where:
    1. The function findArticle is replaced by an application of List.tryFind
    2. The function makeBill is declared using List.foldBack
41 13. Oct. Collections: Sets and Maps
Lecture6.pdf, Lecture6Handout.pdf
HR 5.2-5.3
  1. HR 5.11, 5.7
  2. Solve Problem 1 from the exam fall 2013 (available here). Make a solution on paper first -- the final exam will be laptop-free. Try out your program.
The second mandatory assignment will be released in CampusNet this Friday at 11:30.
It should be submitted under Assignments in CampusNet on Thursday, Oct. 26, 2017.
42 20. Oct. Autumn vacation
43 27. Oct. Finite trees (I)
Lecture7.pdf Lecture7Handout.pdf
HR 6
  1. File System
  2. HR 6.2, 6.8
44 3. Nov. Finite trees (II)
Lecture8.pdf Lecture8Handout.pdf
  1. Solve Problem 2 from the exam fall 2011 (available here). Make a solution on paper first -- the final exam will be laptop-free. Try out your program.
  2. Make an interpreter for a simple imperative language (see exercises on the slides) by completion of this program skeleton.
  3. HR 6.10. The program you should extend is found here.
The third mandatory assignment will be released in CampusNet this Friday at 11:30.
It should be submitted under Assignments in CampusNet on Thursday, Nov. 9, 2017.
45 10. Nov. Efficiency
Lecture9.pdf Lecture9Handout.pdf
HR 9
  1. 9.3, 9.4, 9.6, 9.8
  2. Summer exam 02157-2014, Problem 1(1-3) -- available here
  3. Fall exam 02157-2015, Problem 2(1-3) -- available here
46 17. Nov. Sequences
Lecture10.pdf Lecture10Handout.pdf

A short lecture on verification
HR 11
  1. 11.1, 11.2. 11.3, 11.9, 11.10
  2. Summer exam 2014.Problem 1(4,5) and
    Fall exam 2014.Problem 2(1,2,3) -- available here
47 24. Nov. Modules
Selected topic
HR 7 The fourth mandatory assignment will be released in CampusNet this Friday at 11:30.
It should be submitted under Assignments in CampusNet on Thursday, Nov. 30, 2017.
48 1. Dec. To be decided
49 8. Dec. Course evaluation
Selected topic


Michael R. Hansen, October 25, 2017