[Haskell] randomgen for foreign random functions
Jan-Willem Maessen - Sun Labs East
Janwillem.Maessen at Sun.COM
Mon Jun 28 10:05:39 EDT 2004
Simon Peyton-Jones wrote (in response to Hal Daume):
> | basically, i want to wrap this up as something like:
> |
> | gengam :: RandomGen g => g -> Double -> Double -> (g, Double)
> |
> | analogously to the normal random # generation stuff.
>
> There's a standard approach, originally due to Lennart Augustsson.
>
> Have a single function that generates an infinite supply
> mkSupply :: IO Supply
Note that Simon's code is essentially isomorphic to the splittable
supply library referenced in my last message---but the library gives a
few more knobs you can turn.
Simon, you left out the declaration for "MkSplitUniqSupply"!
-Jan
More information about the Haskell
mailing list