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

Bertram Felgenhauer bertram.felgenhauer at googlemail.com
Fri Sep 12 22:14:24 EDT 2008


Cetin Sert wrote:
[snip]
> colorR :: RandomGen g ⇒ (RGB,RGB) → g → (RGB,g)
> colorR ((a,b,c),(x,y,z)) s0 = ((r,g,b),s3)
>   where
>     (r,s1) = q (a,x) s0
>     (g,s2) = q (b,y) s1
>     (b,s3) = q (c,z) s2
>     q = randomR

Look closely at how you use the variable 'b'.

HTH,

Bertram


More information about the Haskell-Cafe mailing list