Topic 12 - Fundamentals of functional programming - Complete Flashcards

1
Q

Define imperative paradigm?

A

Make use of assignments or statements which are written to and therefore change the state of computer memory. Imperative languages can be translated into efficient machine code.

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

Define functional paradigm?

A

Uses programming languages that evaluate mathematical functions, rather than the imperative method where the values are assigned to variables.

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

Define logic paradigm?

A

Useful in solving problems that involve querying and gaining knowledge from declared facts and their rules.

Prolog is a declarative logic programming language that is widely used in artificial intelligence and in expert system applications.

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

Define object-orientated paradigm?

A

Is based on data structures known as objects, these objects are members of a class which are grouped into a class hierarchy.

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

Define first-class object?

A

Is a language object which supports the operations normally to other entities like:

  • Appearing in expressions
  • Being assigned to a variable
  • Being used as an argument for a function
  • Being returned as an output from a function call
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
6
Q

Define function application?

A

Can be applied to a function that requires more than one argument. This can then be processed by applying the function with some but not all of the arguments needed.

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

Define composition function?

A

Is the process of combining two functions by applying the results of one function to another.
This technique is widely used in functional programming, where complex functions can be constructed by using simpler functions.

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

Define map function?

A

Applies a given function to each of the elements in a list to form another list with results.

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

Define filter function?

A

Is a higher-order function that processes a list of data structure to create a new list containing elements that match the specified criteria.

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

Define even number filter?

A

The filter function example using Haskell is based on finding even numbers in the list.

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

Define reduce or fold function?

A

Is a method that can be used to reduce a list to a single value by combining the list using recursive function.

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

Define list processing?

A

Is a data structure consisting of a list of data elements that are of the same data type and size, the list is named by an identifier and the structure elements stored can be integers, real numbers, characters or text strings.

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

Define empty list?

A

A list with no elements is termed an empty list and is shown using the symbols.

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