On Fri, 1 Dec 2006, Huazhi (Hank) Gong wrote:
myrand :: Int
myrand = randomRIO(1::Int, 100)
concerning random and IO:
http://haskell.org/haskellwiki/Things_to_avoid#Separate_IO_and_data_processing
___
Haskell-Cafe mailing list
Hello,all
My intention is to generate 50 random coordinates like (x,y).
myrand :: Int
myrand = randomRIO(1::Int, 100)
rf=[(myrand, myrand) | a - [1..50]]
My short program is like this. However, GHCI say that the return type of
randomRIO is IO a while the function defined by me is Int. Since I
On 12/2/06, Huazhi (Hank) Gong [EMAIL PROTECTED] wrote:
myrand :: Int
myrand = randomRIO(1::Int, 100)
rf=[(myrand, myrand) | a - [1..50]]
do
let myrand = randomRIO (1 :: Int, 100)
rf - replicateM 50 (liftM2 (,) myrand myrand)
--
Taral [EMAIL PROTECTED]
You can't prove anything.
--
hankgong:
Hello,all
My intention is to generate 50 random coordinates like (x,y).
myrand :: Int
myrand = randomRIO(1::Int, 100)
rf=[(myrand, myrand) | a - [1..50]]
My short program is like this. However, GHCI say that the return type of
randomRIO is IO a while the function defined
Hello,
On 12/1/06, Huazhi (Hank) Gong [EMAIL PROTECTED] wrote:
Hello,all
My intention is to generate 50 random coordinates like (x,y).
myrand :: Int
myrand = randomRIO(1::Int, 100)
When we look at the type of randomRIO we see:
randomRIO :: forall a. (Random a) = (a, a) - IO a
You're