[Haskell-cafe] System.Timeout problems

Neil Mitchell ndmitchell at gmail.com
Sun May 27 11:10:25 EDT 2007


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


More information about the Haskell-Cafe mailing list