Writing functional programs Flashcards

You may prefer our related Brainscape-certified flashcards:
1
Q

What does the map function do?

A

It is a high order function that applies a given function to each item in a list

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

What does the filter function do?

A

It is a high order function that produces a new list containing all items from the input list that meet a given condition

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

What does the fold function do?

A

It is a high order function that reduces a list to a single value by repeatedly applying a combining function

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

What is the result of head([1,2,3,4])?

A

1

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

What is the result of tail([1,2,3,4])?

A

[2,3,4]

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