Functional Programming Flashcards
Which of the following is not true of
first-class objects?
1. They can appear in expressions
2. They can be assigned to a data type
3. They can be assigned as arguments
4. They can be returned in function calls
2
What name is given to the set of outputs from a
function?
Co-domain
Which part of this type signature is the argument
type? f: A -> B
A
What name is given to the set of inputs to a
function?
Domain
f(x) = 4x
g(x) = x/2
What is g o f?
2x
What do functional programs use as first-class
objects?
Functions
What name is given the process of giving particular
input to a function?
Function application
What must be true of two functions if they are to be
combined?
The domain of one of the functions must
be the same as the co-domain of the
other function