Skip to content

Instantly share code, notes, and snippets.

@unclechu
Last active October 5, 2017 22:48
Show Gist options
  • Select an option

  • Save unclechu/6644a85bd8b1c6bdf9c6042d2f0f92a4 to your computer and use it in GitHub Desktop.

Select an option

Save unclechu/6644a85bd8b1c6bdf9c6042d2f0f92a4 to your computer and use it in GitHub Desktop.
stubborn-zombie.hs
#!/usr/bin/env stack
-- stack runghc --resolver=lts-9.6 --install-ghc --package=unix
{-# LANGUAGE UnicodeSyntax #-}
{-# LANGUAGE PackageImports #-}
import "base" Control.Monad (forever)
import "base" Control.Concurrent (threadDelay)
import "unix" System.Posix.Signals
(Handler (Catch), installHandler, sigHUP, sigINT, sigTERM, sigPIPE)
main ∷ IO ()
main = do
putStrLn "I DON'T WANNA DIE!!!111"
mapM_ fokDat [sigHUP, sigINT, sigTERM, sigPIPE]
forever $ threadDelay maxBound
where fokDat sig = installHandler sig (Catch $ return ()) Nothing
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment