Higher order functions Flashcards

1
Q

What does map do

A

Maps a function to a list of elements.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

What does filter do

A

Applies a predicate to pick list elements which return true.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
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

How well did you know this?
1
Not at all
2
3
4
5
Perfectly