[Haskell-cafe] Why is GHCi so hard to kill?

Ruben Astudillo ruben.astud at gmail.com
Thu May 18 08:02:02 UTC 2017


On 18/05/17 03:09, Jeremy Henty wrote:
> Is  there a  reason for  ghci being  so unkillable?   It is  generally
> considered a bad idea for a program to ignore the TERM signal.

it has to do with passing the exception to the program running
inside ghci. Your example didn't manifest it because it was pure
functions

    ghci> (last $ repeat ()) :: ()

and those don't catch exceptions. Yet if you put

    ghci> import Control.Monad (forever)
    ghci> forever (putStrLn "howdy")

it will print forever until you press C-c on your terminal, as IO
actions can react to exceptions and have a default handler for C-c.

SIGKILL acted inmediatly because it isn't really a signal, the kernel
just kills the process.

-- 
-- Ruben

-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 488 bytes
Desc: OpenPGP digital signature
URL: <http://mail.haskell.org/pipermail/haskell-cafe/attachments/20170518/fddb84b5/attachment.sig>


More information about the Haskell-Cafe mailing list