I'm curious, is it possible that your new timeout implementation would fix this problem?:
doesntWork :: Int -> Int
doesntWork x = last $ cycle [x]
test :: IO (Maybe Bool)
test = timeout 1 $ evaluate $ doesntWork 5 == 5 -- never terminates, even with the timeout
From what I can gather, this problem is caused by a lack of context switches in the code for 'doesntWork' so I doubt that a new implementation of timeout would fix it, but I thought I'd ask :)
It's super annoying, especially when it happens when you're not expecting it.
(btw, I've only tested the above code in ghc 6.x, so I have no idea if the behavior is the same in 7)
- Job