
17 May
2010
17 May
'10
11:28 p.m.
When I first started learning Haskell, I was under the impression that monads provided a way to encapsulate some imperative code so it didn't "contaminate" your functional code. But I think that's a misconception that I got because the first monad I dealt with was IO. Lately I've been reading more about monads, and (aside from IO), they are purely functional, aren'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't you don't have to bother with it. Is that correct? TIA.