-
Notifications
You must be signed in to change notification settings - Fork 5
Notes for Week 2 Getting Started
ssanj edited this page Nov 19, 2011
·
28 revisions
Links:
- Chapter 2 summary
- Some basic functions to get you started
- General syntax overview
- Hoogle - A Haskell API search engine
- Hayoo - Another Haskell API search engine
- Eric Meijer's functional tutorial on FP basics
Exercises:
-
Rewrite the following with the use of the notElem (not an element of) function:
[x | x <- [10..20], x /= 13, x /= 15, x /=19]
-
Write the replicate function, in terms of repeat and take. Eg:
replicate 3 10 == ??
-
Write the sum of the numbers in each sublist of xxs without flattening it:
let xxs = [ [1,3,5,2,3,1,2,4,5],[1,2,3,4,5,6,7,8,9],[1,2,4,2,1,6,3,1,3,2,3,6] ]
Eg: [ [x], [y], [z] ], where x,y,z are totals.
-
What is the type of the tuple in the following expression:
([1,2,3], "hello", ['a','b'], (1, 'c', True))
Eg. (True, 'a') is a (Bool, Char)