When I first started learning Haskell, I was under the impression that monads provided a way to encapsulate some imperative code so it didn&#39;t &quot;contaminate&quot; your functional code. But I think that&#39;s a misconception that I got because the first monad I dealt with was IO. Lately I&#39;ve been reading more about monads, and (aside from IO), they are purely functional, aren&#39;t they? If they have state, they deal with it in a purely functional way. Behind the scenes, they thread the state through your computations so that you don&#39;t you don&#39;t have to bother with it. Is that correct? TIA.<br>