On 10 January 2011 10:44, z_axis <[email protected]> wrote: > > betterStdGen :: IO StdGen > betterStdGen = alloca $ \p -> do > h <- openBinaryFile "/dev/urandom" ReadMode > hGetBuf h p $ sizeOf (undefined :: Int) > hClose h > mkStdGen <$> peek p
Maybe use a catch or something here and have it return "IO (Maybe StdGen)", with Nothing denoting that file not existing? -- Ivan Lazar Miljenovic [email protected] IvanMiljenovic.wordpress.com _______________________________________________ Haskell-Cafe mailing list [email protected] http://www.haskell.org/mailman/listinfo/haskell-cafe
