Created
August 14, 2011 12:55
-
-
Save Shimuuar/1144855 to your computer and use it in GitHub Desktop.
withSystemRandom test case
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$ 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) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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