Functional Programming Flashcards

1
Q

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

A

2

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

What name is given to the set of outputs from a
function?

A

Co-domain

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

Which part of this type signature is the argument
type? f: A -> B

A

A

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q

What name is given to the set of inputs to a
function?

A

Domain

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
5
Q

f(x) = 4x
g(x) = x/2
What is g o f?

A

2x

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
6
Q

What do functional programs use as first-class
objects?

A

Functions

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
7
Q

What name is given the process of giving particular
input to a function?

A

Function application

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
8
Q

What must be true of two functions if they are to be
combined?

A

The domain of one of the functions must
be the same as the co-domain of the
other function

How well did you know this?
1
Not at all
2
3
4
5
Perfectly