Normally you write composition like readFile().then(stripComments).then(sort).then(takeFirst), or compose using shell pipes.
Composition is so widespread and so trivial-looking that it's even easy to miss.
Unlike the imperative `;`, which sequences commands in an absolutely obvious way, right?
i doubt it. composition and currying are so fundamental.
This should be reversed. It is not defined this way in mathematics nor in Haskell.
> whip /f/ the butter /x/, then whip the result while adding sugar /y/
That's not a valid explanation, since curried functions don't "act" until they've got all their arguments; i.e. we do not whip any butter until the sugar has been added.
> shape the cookies /x/ on a tray first /g/, then bake them /f/
Whilst this is accurrate, I think introducing a notion of time ("then") makes things much harder than they need to be. (That's one reason I find imperative programs hard to understand)
Curry: f(x, y) = f(x)(y)
For cookies, whip butter with sugar. Curried version: whip /f/ the butter /x/, then whip the result while adding sugar /y/.
Composition: f ⭘ g = f(g(x))
To produce nicely shaped cookies, shape the cookies /x/ on a tray first /g/, then bake them /f/.