Computer Science 340
Programming Languages
Fall 2019, Siena College
Lecture 14: Haskell Types and Functions
Date: Monday, October 7, 2019
Agenda
- Announcements
- Problem Set 3: [HTML] [PDF] next up for grading
- Problem Set 4: [HTML] [PDF] due in just under a week
- Complete the Sebesta Ch. 5 readings and responses and
discussion due by class on Wednesday
- Exam 1 in a week
- Exam available 6-10 PM in RB 202, those who cannot make it email me if you have not yet done so
- Topics: first 5 chapters of Sebesta, all labs and problem
sets to date, basics of Haskell
- Part 1 is pencil and paper, with the only permitted reference
one double-sided 8.5 x 11" page of notes in your own handwriting
- When you complete and submit Part 1, you will be issued Part
2, which will be consist of open book and/or practical programming tasks
- Sample questions coming soon
- More Haskell from Learn You a Haskell for Great Good!
- types
- :t to query the type of an object
- type declarations in function definitions
- Int vs. Integer
- a - a type variable
- polymorphic functions
- typeclasses (kind of like interfaces)
- Eq, Ord, Show, Read, Enum, Bounded, Num, Integral, Floating
- type annotations
- more interesting functions
- pattern matching, and use in recursion
- guards
Terminology
- type variables
- polymorphic functions
- typeclasses
- type annotations