hClose: illegal operation (handle is finalized) and/or <<loop>>

I read in some data from a file (via decodeFile), process it, and write the result back to a file. My last line of code is .... encodeFile (filename++".sol") (gametype,gstree,newiterlist,newstamplist,result) and it is all of the sudden now causing this run-time error: mincfr: kclv5.sol: hClose: illegal operation (handle is finalized) It has been working fine for quite a while, but now quite mysteriously gives this error. (But obviously I have been heavily tinkering with the processing part of the program). If I remove the encodeFile line and instead ... putStrLn $ show result I get this run-time error: <<loop>> Help? thanks, Travis

Travis Erdman wrote:
encodeFile (filename++".sol") (gametype,gstree,newiterlist,newstamplist,result)
mincfr: kclv5.sol: hClose: illegal operation (handle is finalized)
That is a confusing error message caused by a bug in GHC that was just reported a few days ago. The GHC team is fixing it.
putStrLn $ show result
<<loop>>
That is the *real* error message. It means that where you define result, you refer to result also on the right-hand side in a way that is an endless loop instead of well-behaved recursion. We would have to see more of your code to be able to say much more. Regards, Yitz
participants (2)
-
Travis Erdman
-
Yitzchak Gale