rollDice n = do
tmp <- doesFileExist "/dev/urandom"
myGen <- if tmp
then betterStdGen
else (mkStdGen . fromInteger) <$> picoSec
return $ (take 1 $ randomRs (1,n) myGen) !! 0
works but not so elegant?
-----
e^(π.i) + 1 = 0
--
View this message in context:
http://haskell.1045720.n5.nabble.com/How-to-write-such-a-code-elegantly-tp3334329p3334395.html
Sent from the Haskell - Haskell-Cafe mailing list archive at Nabble.com.
_______________________________________________
Haskell-Cafe mailing list
[email protected]
http://www.haskell.org/mailman/listinfo/haskell-cafe