[Haskell-cafe] Re: True Random Numbers

James Cook mokus at deepbondi.net
Mon Apr 5 18:12:53 EDT 2010

As the maintainer of random-fu, I'd be interested to know whether you  
find it useful after further inspection.  It does, in fact, support  
using /dev/random as its entropy source.  I don't know what exact sort  
of things you're wanting to do, but very basic usage (random Int in IO  
from DevRandom, etc.) is along these lines:

 > sampleFrom DevRandom (uniform 1 100) :: IO Int
 > sampleFrom DevRandom stdNormal :: IO Double

If the haddock docs are insufficient, feel free to drop me an email  
for clarification - I know they're a bit spotty at the moment.

Minor warning: I'm getting ready to release a fairly major overhaul of  
the library's innards (the latest is in the darcs repo).  The public  
interface will probably not change much, but if you happen to end up  
using any of the low-level interfaces (such as to define your own new  
random source) just be aware that those are changing soon.  It's  
nearing release, I'm mostly just trying to knock off rough edges and  
trying to decide whether to "take the plunge" and make some interface  
changes (mostly whether I want to hide some data constructors in order  
to better enforce some invariants).

-- James Cook

On Apr 3, 2010, at 1940, Alex Rozenshteyn wrote:

> Looking over the random-fu package, I think it might have what I'm  
> looking for (and a lot that I'm not).
> On Sat, Apr 3, 2010 at 6:27 PM, Gökhan San <gsan at stillpsycho.net>  
> wrote:
> Alex Rozenshteyn <rpglover64 at gmail.com> writes:
> > The Rand monad you linked seems to be a step in the right direction
> > for what I want, but it uses getStdGen, which appears to end up  
> using
> > cpu time to seed the generator.
> There's the random-stream package but looks like it's subject to code
> rot. Its RandomGen instance lacks the split functionality but I  
> guess it
> could be used with MonadRandom.
> --
> Gökhan San
> _______________________________________________
> Haskell-Cafe mailing list
> Haskell-Cafe at haskell.org
> http://www.haskell.org/mailman/listinfo/haskell-cafe
> -- 
>          Alex R
> _______________________________________________
> Haskell-Cafe mailing list
> Haskell-Cafe at haskell.org
> http://www.haskell.org/mailman/listinfo/haskell-cafe

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://www.haskell.org/pipermail/haskell-cafe/attachments/20100405/6d29994c/attachment.html

More information about the Haskell-Cafe mailing list