Higher order functions Flashcards
1
Q
What does map do
A
Maps a function to a list of elements.
2
Q
What does filter do
A
Applies a predicate to pick list elements which return true.
3
Q
Foldr
A
Folds a function into list elements.
i.e. productOf xs = foldr multiply 1 xs
xs = 1,2,3,4,5 returns 120. 11234*5