[Haskell-cafe] random colors, stack space overflow, mersenne and mersenne.pure64

Cetin Sert cetin.sert at gmail.com
Fri Sep 12 23:34:45 EDT 2008


main :: IO ()
main = do
  as <- getArgs
  mt <- newPureMT
  let colors = randomRs (lo,hi) mt :: [RGB]
  print $ zip tx cs
  where
    lo = read $ as !! 0
    hi = read $ as !! 1
    tx =        as !! 2

Why is as not visible in the where block?

2008/9/13 Brandon S. Allbery KF8NH <allbery at ece.cmu.edu>

> On 2008 Sep 12, at 21:57, Don Stewart wrote:
>
>> cetin.sert:
>>
>>>    random  = color2
>>>    randomR = colorR
>>>
>>>  color2 :: RandomGen g .$B"M.(B g .$B"*.(B (RGB,g)
>>>  color2 = colorR (minRGB,maxRGB)
>>>
>>>  color :: RandomGen g .$B"M.(B g .$B"*.(B (RGB,g)
>>>  color s0 = ((r,g,b),s3)
>>>    where
>>>
>>
>> There's some corruption in this text. Could you post the file somewhere?
>>
>
> It's not corrupt; he used UTF-8 symbols.  It shows up properly in Mail.app
> but doesn't quote right (admittedly I force plaintext).
>
> --
> brandon s. allbery [solaris,freebsd,perl,pugs,haskell] allbery at kf8nh.com
> system administrator [openafs,heimdal,too many hats] allbery at ece.cmu.edu
> electrical and computer engineering, carnegie mellon university    KF8NH
>
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://www.haskell.org/pipermail/haskell-cafe/attachments/20080913/b59a8448/attachment.htm


More information about the Haskell-Cafe mailing list