On 10 January 2011 12:25, z_axis <z_a...@163.com> 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
ivan.miljeno...@gmail.com
IvanMiljenovic.wordpress.com

_______________________________________________
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe

Reply via email to