Computing - Functional Programming
See Also
Flashcards
What is the domain of a function?
The set from which you can choose inputs.
What is the co-domain of a function?
The set from which outputs come from.
How can you conceptualise a function as a mapping?
A function maps the domain to the co-domain.
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.
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.
What does a fold function do?
Recursively combine elements of the list.
What does head [1,2,3]
return?
head [1,2,3]
return?1
What does tail [1,2,3]
RETURN?
tail [1,2,3]
RETURN?[2,3]