19 Oct
2009
19 Oct
'09
8:10 a.m.
zaxis wrote:
It works very well. However, as i am used to C style so i want convert it into
winSSQ count noRed noBlue = do { let yesRed = [1..33] \\ noRed; let yesBlue = [1..16] \\ noBlue; bracket (openFile "ssqNum.txt" WriteMode) (hClose) (\hd1 -> pickSSQ count yesRed yesBlue hd1); }
You need to put brackets around the declarations in a let as well: winSSQ count noRed noBlue = do { let { yesRed = [1..33] \\ noRed }; let { yesBlue = [1..16] \\ noBlue }; bracket (openFile "ssqNum.txt" WriteMode) (hClose) (\hd1 -> pickSSQ count yesRed yesBlue hd1); } Regards, apfelmus -- http://apfelmus.nfshost.com