Writing functional programs 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
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
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
4
Q
What is the result of head([1,2,3,4])?
A
1
5
Q
What is the result of tail([1,2,3,4])?
A
[2,3,4]