Functional programming is a declarative programming paradigm that allows you to concentrate on the logic of a computation without describing its control flow. This is in contrast to imperative programming, which uses control statements to describe the flow of programs.
The following diagram represents a simplified classification of programming languages:
![](https://static.packt-cdn.com/products/9781788996648/graphics/assets/240cb805-ed1e-4d83-96b5-a104aef45aff.png)
Functional programming assumes that the software is constructed based on the following principles:
- Pure functions
- First-class functions
- Higher-order functions
- Function composition
- Typeclasses
- Lambdas
- Closures
- Immutability
The following diagram shows a combination of these concepts:
![](https://static.packt-cdn.com/products/9781788996648/graphics/assets/758bfc09-08e9-4d4c-b9aa-bfecf25dd5e8.png)
We'll look at some examples of declarative and imperative styles to get a better understanding. We'll cover all the principles of functional programming just mentioned.