Making a Piña Colada in Haskell: It's All About Concurrency

I was reading The Pragmatic Programmer this morning, and it got me to thinking about Haskell.Consider the following "function" for creating a piña colada:Open blenderOpen piña colada mixPut mix in blenderMeasure 1/2 cup white rumPour in rumAdd 2 cups of iceClose blenderLiquefy for 2 minutesOpen blenderGet glassesGet pink umbrellasServeIt's very easy to understand and very linear.Now consider the following diagram that conveys which parts can be done concurrently: This description of the recipe is quite a bit more complex, but it's a lot more obvious which things can be done concurrently.There are a lot of approaches to concurrency. For years, we've relied on our CPUs to give us some implicit concurrency. The CPU can look at the code at a very micro level and figure out which assembly instructions can be done concurrently because they're working with different parts of memory, etc.Threads and processes also provide concurrency, but they're at a very differe…