finally part run twice on Ctrl-C

Neil Mitchell ndmitchell at gmail.com
Thu Feb 26 05:31:58 EST 2009


Hi,

I've got the following code:

import Control.Exception
import System.Cmd
main = system "sleep 1m" `finally` putStrLn "goodbye"

When compiled with GHC 6.10.1.20090225, if I hit Ctrl-C during the
sleep, I get the goodbye printed twice. If I leave evaluation to
finish normally I get goodbye once. Is this a bug?

Thanks

Neil


More information about the Glasgow-haskell-users mailing list