28 Jun
2004
28 Jun
'04
2:05 p.m.
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