
18 May
2017
18 May
'17
8:02 a.m.
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