Re: still random number problem

2002-07-25 Thread Keith Wansbrough
> What is wrong with it? Take a look at the Wiki, which has some explanation of the IO monad (which you're using here, with the "do" notation): http://haskell.org/wiki/wiki?UsingIo http://haskell.org/wiki/wiki?ThatAnnoyingIoType http://haskell.org/wiki/wiki?UsingMonads Hope this helps! --KW

Re: still random number problem

2002-07-24 Thread Hal Daume III
There are a few things wrong with this... > uni :: IO () -> Float > uni = do > xs <- newStdGen > let >m = (head (randoms xs) :: Float ) presumably, you want 'uni' to produce a random float. in this case, it has the wrong type; it is actually an IO action that returns a F

Re: still random number problem

2002-07-24 Thread Nick Name
On Wed, 24 Jul 2002 19:13:22 +0100 (BST) Junjie Xu <[EMAIL PROTECTED]> wrote: > uni :: IO () -> Float > uni = do > xs <- newStdGen > let > m = (head (randoms xs) :: Float ) let x = expr in something You miss the "in something" part... quite that simple. Vincenzo ___

still random number problem

2002-07-24 Thread Junjie Xu
Hi there, First of all, I would say thank you very much for all who helped me during the past days. Since I am a beginner , sometime I spent even several hours to solve a very simple problem.So, I still need your help in the future. The problem is: ***