DM22, Spring 2006 - Weekly Note 1


Lecture February 7 and 9

Introduction to course. Major programming language categories.

Introduction to Haskell: Functions, the Hugs interpreter, basic types, operators, polymorphism, functions as parameters and results, pattern matching.

Reading

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

Remarks

The textbook is a very 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).


Lecture February 14 (Expected Contents)

More on Haskell: Algebraic types, type classes, built-in types. Standard prelude. The value undefined, lazyness and strictness.

Reading

Chapters 1 to 3 (and some of 4) in Bird.


Exercises February 15

Exercises 1.1.1, 1.1.2, 1.5.1, 2.4.3, 4.8.2, 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.


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