CS 330 Lecture 21 – Hello, Haskell
Agenda
- office hours: come find me anytime between 9 and 4
- midterm discussion
- the problem with imperative languages: mutability
- functional languages
- Haskell
- implicit typing
- operators
- lists and ranges
- conditionals
- functions
TODO
- Read http://www.haskell.org/haskellwiki/Introduction. Quarter sheet.
Code
test.hs
a = 7
b :: Double
b = 8
c = if a == 5 then "Equals 5" else "Doesn't equal 5"
divmod a b = [div a b, mod a b]
initials first middle last = head first