There are ways to write things that are similar with Haskell. Just like there are design patterns for functional techniques in imperative languages,  there are design patterns for imperative techniques in functional language....<p>So for example, here you could make a nice little EC2 DSL that would get your stuff (for the actual Haskellers: Free Monad):<p><pre><code>    spotPrices :: Region -&gt; EC2 [SpotPrice]
    spotPrices = GetSpotPrice -- DSL Leaf, executed by runEC2

    spotPricesForAllRegions :: [Region] -&gt; EC2 [SpotPrice]
    spotPricesForRegions regions =
        concat &lt;$&gt; MapM spotPrices regions
    </code></pre>
Your spot price update function becomes something even simpler now:<p><pre><code>    runEC2 :: EC2 a -&gt; EC2Config -&gt; IO a
    runEC2 = stuff -- this is where you call whatever EC2
    -- lib is available

 
    updateSpotPriceFile :: [Region] -&gt; IO [SpotPrice]
    updateSpotPriceFile regions = do
        spotPrices &lt;- runEC2 (spotPricesForAllRegions regions)
                             (myEC2Configuration)
        writeToFile (toJSON spotPrices) &quot;spotprices.json&quot;
        return spotPrices

</code></pre>
I&#x27;m not going to port all of it, but with a more functional version you could avoid having to keep on making EC2 clients all over the place, and you could keep your config in one place.<p>The problem is that it&#x27;s pretty obtuse if you don&#x27;t know the right design patterns. There&#x27;s a myth in FP circles that design patterns are for OOP only (&quot;we have functions, we don&#x27;t need observer patterns!&quot;), but it&#x27;s a myth. But if you get good, you can write some pretty concise code + get all the goodies.<p>Haskell has the whole GHC thing, and also the issue of lack of good library documentation (or lack of libraries on certain stuff)...