haskell-numerics / random-fu

A suite of Haskell libraries for representing, manipulating, and sampling random variables
42 stars 21 forks source link

Default random source on Linux #17

Open leonbaum opened 10 years ago

leonbaum commented 10 years ago

According to the docs, the sample function should use the default random source for the monad, which according to the Data.Random.Source.IO docs is DevRandom for the IO monad on Linux.

That can't be right, can it? If I run sampleFrom DevRandom, the performance is terrible (as expected), but sample seems similar to sampleFrom mwc. Is MWC actually the default on Linux?

mokus0 commented 10 years ago

The comment could stand to be clearer. It's referring to the "DevRandom" type, which includes constructors that reference both /dev/random and /dev/urandom. It uses the one corresponding to /dev/urandom. When I get a bit more time (hopefully this weekend) I'll clarify the docs.