It seems the problem is indeed in rmat:

> rmat n =    listArray ((1,1),(n,n)) $ map ct (randoms (mkStdGen 1) ::[Bool]) 
>             where   ct True = Unknown
>                     ct False = Dead

To be more precise, the problem is in randoms. If you replace rmat
with the following

rmat n =    array ((1,1),(n,n)) $ 
   zipWith (\ind v -> v `seq` (ind,v)) [(i,j) | i<-range, j<-range] $ 
   map ct (randoms (mkStdGen 1) ::[Bool]) 
             where   ct True = Unknown
                     ct False = Dead
                     range = [1..n]
then
> main = putStrLn $ show $ forpaintbdry $ rmat 400

computes without problems (compiled with GHC 5.04.1, no flags). BTW,
GHCi didn't have any problem even with the original code.


_______________________________________________
Haskell-Cafe mailing list
[EMAIL PROTECTED]
http://www.haskell.org/mailman/listinfo/haskell-cafe

Reply via email to