
上QQ阅读APP看书,第一时间看更新
Function composition
Function composition is where we combine two smaller functions to create a new function that accomplishes the same goal as the two smaller ones. Both ways get us from an a to c. Below, f1 accepts an a and returns a b. f2 accepts a b and returns a c. We can compose/combine those two functions and get a single function that accepts an a and returns a c:

Function composition is the cornerstone to pure FP; It's what allows us to build larger abstractions out of smaller ones.