Functional Programming Concepts
Tue Oct 04 2016
5 min read
Cumilla, Bangladesh
Purity
Pure functions only operate on its input parameters.
No side effects.
Immutability
There are no variables in FP
Loops are implemented via recursion
Higer Order Functions
- Higher order functions take functions as parameter or returns a function or does both.
Closure
- A closure is a functions scope kept alive by a reference to that function.
Function Composition
Put together reusable functions to compose new functions.
More like the concept of composite function f(g(x)) from math.
Point Free Notation
- In this notation, no need to specify parameters when writing functions.
Currying
A curried function is a function that takes only one parameter at a time.
This helps make functions more generalized for reuse.
Summarised from here