Section 12 - Functional programming Flashcards
What is a programming paradigm?
A style of computer programming
What are the 4 types of programming paradigms?
- Procedural programming
- Object-orientated programming
- Declarative programming
- Functional programming
What is procedural programming?
Where a series of instructions tells the computer what to do with the input in order to solve the problem
What is structured programming?
A form of procedural programming which uses the modular techniques to split large programs into manageable chunks
What programming constructs does structured programming use?
- Sequence
- Selection
- Iteration
- Recursion
What is object-orientated programming?
A programming paradigm comprised of classes of objects. It is was developed to make it possible to abstract details of implementation away from the user, making code reusable and programs easy to maintain
What is declarative programming?
Where you write statements the describe the problem to be solved, with the language implementation deciding the best way to solve it
What is functional programming?
Functions are used as the fundamental building blocks of a program, where statements are written as a series of functions which accept input data as arguments and return an output
What is a function?
A mapping from the domain to the co-domain
What is the domain?
The set of inputs
What is the co-domain?
The set of possible outputs
What is always true about the domain and co-domain?
They are always subsets of objects in some data type
What is Haskell?
A functional programming language
What is a parameter in Haskell?
A reference declared in a function declaration
What is an argument in Haskell?
A value or expression passed to a function
What is function application?
The process of giving particular inputs to a function