haskell / mwc-random

A very fast Haskell library for generating high quality pseudo-random numbers.
http://hackage.haskell.org/package/mwc-random
BSD 2-Clause "Simplified" License
55 stars 25 forks source link

Move splitGen to mwc-randon #39

Open Shimuuar opened 9 years ago

Shimuuar commented 9 years ago

We have following function in statistics:

splitGen :: Int -> GenIO -> IO [GenIO]
splitGen n gen
  | n <= 0    = return []
  | otherwise =
  fmap (gen:) . replicateM (n-1) $
  initialize =<< (uniformVector gen 256 :: IO (U.Vector Word32))

I thing it makes sense to move it to mwc-random and generalize to PrimMonad. We however need to understand consequences of such splitting algorithm