DM509, Fall 2006, 2nd quarter - Weekly Note 1

Announcement

All students of Imada should once a year attend a "Studieorienterende Samtale" (a 10 minutes meeting with at faculty member to guide you in the planning of your study). The meetings are held currently, in Week 45 and 46 (i.e., this week and the next). Sign up for at time slot at the departemental office.


Lecture November 6

Introduction to course. Major programming language categories.

Introduction to Haskell: Functions, the Hugs interpreter, basic types, operators.

Reading

Chapter 1 in Bird. Slides (Intro to Course, Haskel Intro I).

Remarks

The textbook is a solid introduction to functional programming as a science. However, as an introduction to the langauage Haskell it is a bit sketchy. More precisely, a large number of parts of Haskell are touched upon in Chapter 1, but only with a passing mentioning. A more thorough coverage of Haskell elements are found in the slides from the lectures, and in the additional material on the main course page. It is necessary to read the lecture slides along with Chapter 1 (and to some extent with Chapters 2 and 3). You will in the first few lectures meet a lot of Haskell in a short time. The next period of the course will focus more on doing some actual programming in Haskell.

A main aim of the book is to teach functional programming as a mathematical activity. In this course, we initially will concentrate on learning Haskell the language, and getting some code running. Although it is one of the key virtues of functional programming that it is much easier to reason about than imperative programming, we will postpone this subject until a bit later in the course. Hence, for the moment you can (and probably should) skip all parts of the sections read which deal with proofs of identities, as well as those dealing with the undefined value ("bottom") and strict and non-strict functions. We will return to these later. Instead, put some time into reading the slides, and browse some of the material under point "Additional Material" at the main course page.


Lecture November 7

More on Haskell: polymorphism, functions as parameters and results, pattern matching.

Reading

As above.


Lecture November 9

More on Haskell: Algebraic types, type classes, built-in types and classes. More Haskell syntax, including list comprehensions. Useful functions on lists.

Reading

Chapter 2, Section 3.4 (3.5-6 is nice to read too, but not mandatory), and non-proof parts of Section 4.3 in Bird. Slides: Haskell Intro II. For simple examples of Haskell code, see this file.


Lecture November 16 (Expected Contents)

More extensive examples of Haskell code (definition of some library functions, actual Haskell programs).

Reading

Rest of (non-proof parts of) Sections 4.1-5 in Bird. Section 5.5 in Bird.


Exercises November 13

Exercises 1.1.1, 1.1.2, 1.1.3, 2.2.1, 2.2.2, 2.3.2, 2.4.3, 4.2.8, 4.3.1, 1.4.1, 1.4.6, and 1.4.7 in Bird.

Define a function

elemNum :: Int -> [Int] -> Int
such that elemNum x xs counts the number of times that x appears in xs.

Define a function

unique :: [Int] -> [Int]
such that unique xs returns the list of elements of xs which appear exactly once.


Exercises November 17

Exercises 1.4.2, 2.1.6, 2.2.1, 2.2.2, 2.7.2, 4.1.4, 4.2.1, 1.6.2, 2.3.2, 2.3.3, and 4.3.3 in Bird.

Exam of DM22, summer 2005 (pdf), question 1, part a.


Maintained by Rolf Fagerberg (rolf@imada.sdu.dk)