[Haskell-cafe] Re: Doing without IORef

Bryan O'Sullivan bos at serpentine.com
Fri Apr 4 12:56:35 EDT 2008


Jinwoo Lee wrote:

> I haven't used ReaderT. What are the advantages when using ReaderT
> instead of StateT in this case?

A StateT lets you replace one IORef with another, since it gives you
mutable state.  A ReaderT gives you *immutable* state, so the type
system guarantees that you'll always be using the same IORef.

	<b


More information about the Haskell-Cafe mailing list