
27 May
2007
27 May
'07
3:10 p.m.
Hi
$ ghc --version The Glorious Glasgow Haskell Compilation System, version 6.6.1
-- TEST 2 import System.TimeoutGHC
main :: IO () main = do r <- timeout (length [1..]) (putStrLn "here") print r
Now, with either -threaded, or without, it never terminates.
This is expected, as it looks at n before doing anything. I'm not sure why it does so though; it would be nice if timeout just acted as if n was positive and left other cases to the caller.
Woops, I intended to make length [1..] the action, and leave 5 seconds as the timeout... Thanks Neil