
6 Jul
2004
6 Jul
'04
3:36 p.m.
sholderm@students.cs.uu.nl wrote: <snip>
Use
(getStdRandom (randomR (1,6))) :: IO Int
This much is fine, but...
instead.
\begin{code} module Main where import Random
main :: IO () main = do n <- (getStdRandom (randomR (1,6))) :: IO Int ; print n \end{code}
Layout error: the semicolon must be indented further than the `n' is. Furthermore, the semicolon is unnecessary; if it's deleted, yielding
main :: IO () main = do n <- (getStdRandom (randomR (1,6))) :: IO Int print n
the code works just fine. Jon Cast