X) Functional Programming and Big Data Flashcards
Functional Programming Paradigm
A language where each line of code calls a function, which is made up of other functions or result in a value.
- Statements are written as a series of functions.
- Each accepts input data as arguments and returns an output.
Declarative Programming Languages
A language that declares or specifies what properties a result should have. Example; Functional Programming.
Procedural Programming Languages
A language where the programmer specifies the steps that must be carried out in order to achieve a result.
Why Functional Programming Paradigms are used?
- Code is much easier to write.
- Easier for the programmer to understand.
- Easier to predict how the program will run.
- Used for writing programs which take advantage of parallel processing.
A Function type
Refers to the way in which an expression is created.
Domain and Co-domain
A domain is a set of data of the same type, which are the inputs of the function.
A Co-domain is a set of values from which the outputs of a function must be drawn.
Types and type classes
Functional languages such as Haskell use types such as; Integer, FLOAT, Bool & Char.
Typeclasses are sets of types, e.g. Num;
Includes, Integer + Float.
First Class objects
A first-class object is any object that can be used as an argument or result of a function call. These objects can be assigned to a variable, assigned as an argument and can be returned in a function call.
Statelessness
In a procedual program the following statement is able to be executed:
x = 5
x = x + 1
In a functional programming language, the value of a variable cannot change.
Variables are immutable and the program is said to be stateless.
Referential Transparency
The only thing a function can do is calculate and return a result, it has no SIDE EFFECTS.
On the other hand, not being able to change the value of an object, results in the function returning the same result.
Function Application
The process of giving particular inputs to a function. Example:
add3integers x y z = x + y + z
add3integers :: integer [2] -> (integer [4] ->
( integer [5] -> integer [11] ) )
add3integers 2 4 5
11
What is Big Data?
Big data is data that is collected on such a large scale that it cannot be easily analysed.
Large organisations collect and use big data, such as the police, NHS and the government.
Characteristics of big data
Volume- the amount of data being collected is on a very large scale.
Variety- the type of data being collected is wide, can be difficult to classify.
Velocity- the data changes quickly and may include constant changes in data sources.
Map and fold operations
Map and reduce operations can be efficiently paeallelised, many processors can work simultaneously on parts of a dataset without affecting other parts.
Graph schema
Can represent the structure and relationships between data items.