
9 Jan
2011
9 Jan
'11
9:32 p.m.
On 10 January 2011 12:25, z_axis
thanks for all of your replies. I will test your code later. Another newbie question is why has the following code indentation problem ?
rollDice n = do let myGen = if doesFileExist "/dev/urandom" then betterStdGen else (mkStdGen . fromInteger) <$> picoSec return $ (take 1 $ randomRs (1,n) myGen) !! 0
I don't see an indentation problem, but I _do_ see a type problem: doesFileExist presumably uses IO, and as such can't be used as a Bool for the if statement. -- Ivan Lazar Miljenovic Ivan.Miljenovic@gmail.com IvanMiljenovic.wordpress.com