The third lecture covered up to slide 9 in the lecture slides.
You should have learnt about lists, list comprehensions, and QuickCheck and you should now be able to attempt the list comprehension parts of the tutorial exercise.
The required reading is chapters 4 to 7 in the textbook (pp. 67-176).
Today’s material was particularly important because lists are a fundamental data structure in Haskell. Understanding how lists, comprehensions, and recursion (to come in the next lecture) work are key to understanding the rest of the course. Much of the material to come will be built upon these concepts. So:
- Keep on top of the reading! There is a lot of material in the textbook so reading small sections frequently will allow you to get through it all in time for the next class. Try the exercises!
- Get started on the tutorial exercises! You must have these done ready for your tutorial class. The sooner you start, the more time you’ll have to ask for help if you get stuck. And do ask for help.
- There are no silly questions, only silly people who don’t ask questions!
- Don’t forget that you can ask questions by posting comments on this blog. This is useful for your classmates as everyone will see the answers.
Also in today’s lecture pairs were introduced. A pair (a,b) and in general an n-tuple (a,b,c,…) differs from a list in the following ways:
- Lists can hold an arbitrary number of items, but tuples contain a fixed number (e.g. a pair contains two items, a triple or 3-tuple contains three items, an n-tuple contains n items).
- The items in a list must all be of the same type, but in a tuple each item may have a different type.