Re: monadic source of randomness

2000-08-15 Thread Koen Claessen
Shin-Cheng Mu wrote: | Undoubtedly you can write your own monad and encapsulate | the random number generation yourself. It is just an | instance of a state monad. A state monad has (like you say) the disadvantage that it is single threaded. A big problem then is laziness; it becomes impossi

Re: monadic source of randomness

2000-08-15 Thread Shin-Cheng Mu
Hello, Undoubtedly you can write your own monad and encapsulate the random number generation yourself. It is just an instance of a state monad. Nevertheless, the problem of using state monads for random number generation is that the code must be single-threaded, which is sometimes too restric

Re: monadic source of randomness

2000-08-10 Thread Dana Harrington
>>> Does anybody know of work using monads to encapsulate a source of >>> random numbers? >> Is the global random number generator, in section >> 17.3 of the Haskell 98 library report, the sort of thing you're after? > No; that appears to embed a generator in the IO monad. Not what I'd > hoped f

Re: monadic source of randomness

2000-08-10 Thread Fergus Henderson
On 09-Aug-2000, Carl R. Witty <[EMAIL PROTECTED]> wrote: > Norman Ramsey <[EMAIL PROTECTED]> writes: > > > Does anybody know of work using monads to encapsulate a source of > > random numbers? A quick web search suggested Haskell 98 did not take > > this path. I'd be curious for any insights w

Re: monadic source of randomness

2000-08-09 Thread Carl R. Witty
Norman Ramsey <[EMAIL PROTECTED]> writes: > Does anybody know of work using monads to encapsulate a source of > random numbers? A quick web search suggested Haskell 98 did not take > this path. I'd be curious for any insights why, or any suggestions > about a `randomness monad'. My guess as t

Re: monadic source of randomness

2000-08-09 Thread Norman Ramsey
> > Does anybody know of work using monads to encapsulate a source of > > random numbers? > Is the global random number generator, in section 17.3 of the Haskell > 98 library report, the sort of thing you're after? No; that appears to embed a generator in the IO monad. Not what I'd hope

monadic source of randomness

2000-08-09 Thread Tom Pledger
Norman Ramsey writes: > Does anybody know of work using monads to encapsulate a source of > random numbers? A quick web search suggested Haskell 98 did not take > this path. I'd be curious for any insights why, or any suggestions > about a `randomness monad'. > > > Norman Hi. Is the

monadic source of randomness

2000-08-09 Thread Norman Ramsey
Does anybody know of work using monads to encapsulate a source of random numbers? A quick web search suggested Haskell 98 did not take this path. I'd be curious for any insights why, or any suggestions about a `randomness monad'. Norman