Fundamentals of Functional Programming Flashcards

1
Q

What is meant by the term ‘Domain’?

A

Set from which the functions input values are chosen

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

What is meant by the term ‘Co-Domain’?

A

Set from which the functions output values are chosen

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

What is a Higher-order Function?

A

A function which takes another function as an argument and/or returns a function

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

What does the ‘map’ higher-order function do?

A

Applies a given function to each element of a list, returning a list of results

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

What does the ‘filter’ higher-order function do?

A

Processes a data structure, typically a list, in some order to produce a new data structure containing the elements from the original data structure that match the given condition

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

What does the ‘reduce’ or ‘fold’ higher-order function do?

A

Reduces a list of values to a single value by repeatedly applying a combining function to a list of values

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

What is partial function application?

A

The process of fixing arguments of a function, producing another function with less arguments. For example:

function add(a,b) = a + b

becomes…

function addTwo(a) = a + 2

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

What is a first-class object?

A

First-class objects in functional programming are entities that can be passed as arguments to functions, returned from functions, and assigned to variables.

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