[Haskell] ST vs State

Donald Bruce Stewart dons at cse.unsw.edu.au
Wed May 30 05:01:51 EDT 2007


federico.squartini:
> Hello dear Haskellers,
> 
> Could someone be kind and explain with some detail what are the
> differences between the two monads:
> 
> Control.Monad.ST
> And
> Control.Monad.State
> ?
> 
> They are both meant to model stateful computation but they are not the
> same monad. The first one represents state with in place update?
> 

Very very different.

The former is for filling memory blocks in a pure manner, the latter
models threaded state.

-- Don


More information about the Haskell mailing list