8 Aug
2001
8 Aug
'01
6:41 p.m.
Hannah Schroeter wrote: | * thread a random generator through randomPick, giving it the | type signature: | randomPick :: (RandomGen g) => g -> Int -> [a] -> ([a], g) It is not necessary to thread the random generator through. This is the reason why the "split" function exists in the Random library. Instead of a "stateful" (and strict) computation, one can distribute different random seeds over one's (lazy) computation. So, randomPick only has to have the following type: randomPick :: StdGen -> Int -> [a] -> [a] Invoking it on the same generator will give the same results. /Koen.