Computing - Functional Programming
AQA Computer Science 2022
See Also
Flashcards
Functions, domains and mappings
What is the domain of a function?
The set from which you can choose inputs.
How can you conceptualise a function as a mapping?
A function maps the domain to the co-domain.
Purity and statelessness
If the variables in a program are immutable, what can you say about the program?
It is stateless.
What is referential transparency?
Where you can replace the value of a function call with the value returned.
Higher-order functions
What is a higher-order function?
A function that takes a function as an argument or returns a function.
What is a predicate function?
A function that returns only true or false.
What is the function called that a higher-order filter calls in order to decide if something is allowed in the list?
A predicate.