[Haskell-cafe] STM and random numbers

Henning Thielemann lemming at henning-thielemann.de
Fri Jan 12 12:26:35 EST 2007


On Fri, 12 Jan 2007, Robert Dockins wrote:

> Humm... I'd actually suggest you stop trying to break the rules, and use the
> portion of the random interface that doesn't require IO.  You can pretty
> easily wrap a StdGen using StateT, and write your stuff in the monad (StateT
> StdGen STM).
> 
> Or, (and I'm amazed this hasn't been done before), you can create a custom
> random monad that wraps up this behavior.

http://haskell.org/haskellwiki/New_monads/MonadRandom


More information about the Haskell-Cafe mailing list