Combining Currying and Composition
Learn how to use currying and composition together for functions that take multiple arguments.
We'll cover the following...
Function with one parameter value
Composing is easy when we have a scenario like this:
- Function
ONE
accepts a parameter of typeA
and returns a value of typeB
. - Function
TWO
accepts a parameter of typeB
and returns a value of typeC
. - Function
THREE
accepts a parameter of typeC
and returns a value of typeD
.
Note how function TWO
needs a value that function ONE
can provide, while function THREE
needs a value produced by function TWO
. This means that these functions can be ...