On 10 January 2011 12:25, z_axis <[email protected]> wrote: > > 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 [email protected] IvanMiljenovic.wordpress.com _______________________________________________ Haskell-Cafe mailing list [email protected] http://www.haskell.org/mailman/listinfo/haskell-cafe
