u/f0rgotin r/haskell • Recommends
On “How to think functional?”
Not a pitfall, but instead an insight that has only grown stronger with time - **composition** is at the heart of functional programming.
Composition is important because you can build complex behavior out of simpler parts. This allows you to think about a *single* problem at a time, and then glue the solutions together. See Why functional programming matters.
As functional programmers, we can compose functions, we can compose data types, and we can compose computations (among other things).
For each of those categories of things, we have tools to ensure that they can be composed.
For functions, we have currying and partial application to make sure that every function is a one-argument f…