Last active
October 5, 2017 22:48
-
-
Save unclechu/6644a85bd8b1c6bdf9c6042d2f0f92a4 to your computer and use it in GitHub Desktop.
stubborn-zombie.hs
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/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