On Thu, Aug 12, 2010 at 1:25 PM, Wei Hu <wei....@gmail.com> wrote: > Anyone care to explain why? I also tested a slightly changed program > pasted below, and am very confused. > > > main = do > > -- This call doesn't terminate, why? > > print $ nonTermination "a" > > -- Comment the above line to test the rest of the code > > -- RTS detects the loop and bails out > > print $ process "abc" > > -- Comment the above line to test the rest of the code > > inp <- readFile "input" > > -- I'm guessing (process inp) throws an exception, > > -- and the handler closes all files, making a second close fail? > > writeFile "output" $ process inp > > > process :: String -> String > > process xs = blackhole where blackhole = tail blackhole > > > nonTermination :: String -> String > > nonTermination _ = blackhole where blackhole = blackhole >
If you compile the program to use the non-threaded RTS does the behavior change? Jason
_______________________________________________ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe