Writing Functional Programs (AQA A-Level Computer Science): Quizzes
📚Quizzes
Practise the questions
10 questions from this quiz
ShowHide
Practise the questions
10 questions from this quiz
What is a higher-order function?
What is a higher-order function?
A function that takes or returns functions
What does the map function do to a list?
What does the map function do to a list?
Applies a function to each element
What happens to the original list when map is applied?
What happens to the original list when map is applied?
It remains unchanged
What type of function does filter use to test each element?
What type of function does filter use to test each element?
A predicate function
What must a predicate function return?
What must a predicate function return?
A Boolean value (TRUE or FALSE)
What does the reduce or fold function do?
What does the reduce or fold function do?
Combines list values into a single value
What restriction applies to data types in a list?
What restriction applies to data types in a list?
All elements must be the same type
What is the tail of a list?
What is the tail of a list?
All elements apart from the head
What does head [1,2,3,4,5] return?
What does head [1,2,3,4,5] return?
1
How is an empty list represented?
How is an empty list represented?
[]
