Skip to content

Instantly share code, notes, and snippets.

@Shimuuar
Created August 14, 2011 12:55
Show Gist options
  • Save Shimuuar/1144855 to your computer and use it in GitHub Desktop.
Save Shimuuar/1144855 to your computer and use it in GitHub Desktop.
withSystemRandom test case
$ ghc --make foo
[1 of 1] Compiling Main ( foo.hs, foo.o )
Linking foo ...
$ ./foo
"Starting IO"
Warning: Couldn't open "/dev/urandom"
Warning: using system clock for seed instead (quality will be lower)
"Starting IO"
foo: nonexitant: openFile: does not exist (No such file or directory)
import System.Random.MWC
main = withSystemRandom $ const $ do
print "Starting IO"
putStrLn =<< readFile "/nonexitant"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment