Olaf makes good suggestions about Haskell 98 library module
Random.  I propose to write them into the report.

Simon

-----Original Message-----
From: Olaf Chitil [mailto:[EMAIL PROTECTED]] 
Sent: Monday, November 30, 1998 1:42 PM
To: Simon Peyton-Jones
Subject: Haskell 98: randomIO


Hi Simon,

I just had a look at the Random module of the Haskell 98 library report
(strangely the HTML title is Haskell 1.3 Library Report) 

1. The module only exports random, not randomIO.

2. Nowhere is stated that the produced lists are infinite. The functions
could
simply produce the empty list ;-)

3. Although the lists are infinite some programmers may prefer to call
randomIO
several times expecting different numbers. Currently the description just
contains the following sentence about randomIO

The randomIO function is similar to random except that it obtains an initial
seed in some system-dependent manner. 

I think that the report should definitly rule out the possiblity that every
evaluation of randomIO uses the *same* initial seed.

The expression

        (accumulate.take 10.repeat) (randomIO (1,100) >>= return.head) >>=
print

(accumulate -> sequence in H'98)
should not necessarily give the same as

        randomIO (0,100) >>= (print.take 10)

but certainly a pseudo-random sequence as well (in contrast to the current
implementation in Hugs, I don't know about ghc).


Olaf


Reply via email to