Table of contents
Introduction
- Named after the scientist Haskell B Curry
- It is a concept from lambda calculus
- Currying will convert a function with multiple parameters into a function with single parameters and will perform a series of unary operations
- Currying makes the code more concise and easy to read
How to achieve currying
Currying can be achieved in two ways
a. Using closure
We know that in closure the outer function scope is present till the innermost function, we can use this knowledge for our benefit
- As functions are first-class objects we can return nested functions , we can leverage this to our benefit
b. Using bind, apply method