Functional Programming Flashcards

1
Q

What is a first class object?

A

Any object that can be passed as an argument or can be returned by a function.
A function is a first class object.

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

What is an argument?

A

The data that is passed through a function when its called.

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

What is a highest order function?

A

A function which can accept another function as an argument

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

What are the domain and codomain?

A

The domain contains the inputs, whilst the codomain contains the outputs

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

What is a partial function?

A

A partial function fixes the number of arguments that can be passed, in a function which contains any number of arguments

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

What is Function Composition?

A

The process of creating a new function by combining two existing functions.

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

What is Function Composition?

A

The process of creating a new function by combining two existing functions.

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

What is the map function?

A

The map function applies a given function to every element within a list and returns the list of results

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

What is the filter function?

A

A function that processes a list and creates a new list that contains elements that match a certain criteria

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

What is the fold function?

A

A function that takes a list of values and reduces it to a single value by applying a combining function

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

What is a list?

A

A set of data items of the same type, stored under one identifier

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

What is the head?

A

The first element in the list

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

What is the tail?

A

All the elements apart from the head

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

How does a map function work?

A

The map function applies the function to each list element by applying it to the head first. A recursive call is then made on the tail of the list.

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