Computer Science 340
Programming Languages
Fall 2019, Siena College
Lecture 12: Haskell
Date: Wednesday, October 2, 2019
Agenda
- Announcements
- Office hours today: after class until about 11, 2-3 PM
- Problem Set 3: [HTML] [PDF] finish up in the next couple days
- Problem Set 4: [HTML] [PDF] get going as soon as you can once the tokenizer is set
- More Haskell from Learn You a Haskell for Great Good!
- functions in Haskell
- must not begin with uppercase letters
- Haskell's if/then/else (it's an expression!)
- definitions: functions that take no parameters (but they're still functions!)
- the let keyword
- lists and list operations and functions
- notation
- concatenation
- construction
- nesting
- accessing by index
- comparisons (use lexicographic order)
- head, tail, last, and init
- length
- null (is a function)
- reverse, take, and drop
- minimum and maximum
- sum and product
- elem
- ranges
- infinite lists
- cycle, repeat, and replicate