functional programming Flashcards

You may prefer our related Brainscape-certified flashcards:
1
Q

programming paradigm

A

is a style of computer programming. different programming languages support tackling problems in different ways.

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

procedural programming

A

is supported by languages such as python or pascal, which have a series of instructions that tell the computer what to do with the input in order to solve the problem.
widely used in educational environments, being relatively easy to learn and applicable to w ide variety of problems

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

structured programming

A

is a type of procedural programming which uses the programming constructs of sequence, selection, iteration and recursion. it uses modular techniques to split large programs into manageable chunks.

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

object oriented programming

A

is supported by languages such as java, python and delphi. OOP was developed to make it possible to abstract details of implementation away from the user, make code reusable and programs easy to maintain. it is to a great extent taking over from procedural memory.

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

declarative programming

A

is supported by languages such as SQL, where you write statements that describe the problem to be solved, and the language implementation decides the best way of solving it. SQL is used to query databases.

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

functional programming

A

is supported by programming languages such as haskell, as well as python, c# and java. functions not objects or procedures, are used as the fundamental building blocks of a program. statements are written as a series of functions which accept input data as arguments and return an output.

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

domain

A

a set from the functions input values are chosen

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

co-domain

A

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
9
Q

arguement

A

is a value or expression passed to a function

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

parameter

A

is a reference declared in function declaration

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

function application

A

the process of giving particular inputs to a function

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

first-class objects

A

is an object which may:
- appear in expressions
- be assigned to a variable
- be assigned as an argument
- be returned in a functional call

e.g. integers, floating point values, characters and strings. functions are also first-class objects so may themselves be passed as arguments

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

stateless

A

in a functional programming language, the value of a variable cannot change. variables are said to be immutable.

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

no side affects

A

the only thing a function is calculate something and return a result, and it is said to have no side effects

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

referential transparency

A

a consequence of not being able to change the value of an object is that a function that is called twice with the same parameters will always return the same result.
makes it relatively easy for programmers to write correct, bug-free programs

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

composition of functions

A

the combination of two functions to produce a new function that performs the two functions in a specified order

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

types

A

sets of values

18
Q

typeclasses

A

sets of types

19
Q

high order function

A

is one which either takes a function as an argument or returns a function as a result, or both

20
Q

partial function application

A

decomposing multi-argument functions into smaller functions with fewer arguments

21
Q

map

A

a high order function that applies a given function to each element of a list, returning a list of results

22
Q

list

A

is a collection of elements which can be written in square brackets, e.g. [3, 7, 5, 8].
the empty list is written [].

23
Q

filter

A

a high order function which takes a predicate (to define a boolean condition) and a list. this returns the elements within the list that satisfy the boolean condition

24
Q

fold/reduce

A

a high order function which reduces a list of values to a single value, using recursion - by repeatedly applying a combination function to the list values.

25
Q

prepending

A

adding an element to the front of a list

26
Q

appending

A

adding an element to the end of a list

27
Q

immuatable

A

an objects state can never be changed

28
Q

head-tail representation

A

a method of representing a list in two parts: a head which is the first element of the list, and a tail is the remainder elements of a list

29
Q

big data

A

an umbrella term used to refer to typically unstructured datasets that are large in terms of size, velocity, variety,

30
Q

volume

A

to big to fit on a single server

31
Q

velocity

A

milliseconds or seconds to respond, particularly with streamed data

32
Q

varierty

A

the data may be in many forms such as structured, unstructured, text or multimedia

33
Q

big data analysis and processing

A

enables us to detect and analyse relationships within and among individual pieces of information that previously we were unable to grasp

34
Q

examples of big data

A
  • healthcare
  • google
  • amazon
35
Q

writing correct code

A
  • functional languages have no side effects:
    a function is said have a side effect if it modifies the state of the calling program in some way.
  • functional programming languages support higher order functions:
    a higher order function is one which does at least one of the following
    • take one or more functions as input
    • outputs a function
      e.g. map function
  • functional programming languages forbid assignment:
    in a functional programming language such as haskell, you cannot write statement as the property is known as immutability. an immutable object is one whose state cannot be modified after it is created.
36
Q

why is it important for processing across many servers?

A

it makes parallel processing extremely easy, because the same function always returns the same result

37
Q

fact based model

A

a data model consisting of facts such that each fact captures a single piece of information

38
Q

graph schema

A

a data model where the structure of a database is defined in terms of does, edges and properties.

39
Q

edges (graph schema)

A

the representation of a relationship between entities

40
Q

nodes (graph schema)

A

the representation of an entity

41
Q

properties (graph schema)

A

the representation of attributes and information stored with each entity

42
Q
A