Computer Science 340
Programming Languages
Fall 2019, Siena College
Lecture 13: Haskell
Date: Friday, October 4, 2019
Agenda
- Announcements
- Problem Set 1 grades are up, please take a look, make sure all is accurate and that you understand those things that weren't quite right
- Problem Set 3: [HTML] [PDF] finish up if you haven't
- Problem Set 4: [HTML] [PDF] due in a little over a week
- Coming soon: evening exam on Monday, October 14, available 6-10 PM, take any 2 hours
- New reading and group assignment: Sebesta Ch. 5, see your email for
the link to the shared document to edit
- In-class review exercise on Haskell so far
- Given the list a = [1,2,3,4,5], what is the result of each of
the following?
length a
head a
tail a
init a
last a
- Given a list a, how would you do each of the following?
- retrieve the 3rd element of the list
- generate a new list which has all of the list elements of
a followed by another copy of all of the list elements of
a
- generate a new list which has the same elements as a, but rotated right by 2, so [1,2,3,4,5] would become [4,5,1,2,3].
- Write a function to compute the area of a circle, given its
radius
- More Haskell from Learn You a Haskell for Great Good!
- list comprehensions
- tuples
Terminology
- list comprehensions
- tuples