Created
February 26, 2018 20:32
-
-
Save gromakovsky/e55659aab6274b1ac338486e87d274c3 to your computer and use it in GitHub Desktop.
This file contains 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
name: kill | |
version: 0.4.9 | |
build-type: Simple | |
cabal-version: >=1.10 | |
executable kill | |
hs-source-dirs: . | |
main-is: kill.hs | |
build-depends: base >= 4.9.0.0 && < 5.0.0.0 | |
, safe-exceptions | |
ghc-options: -threaded -rtsopts -with-rtsopts=-N -Wall | |
default-language: Haskell2010 | |
default-extensions: TypeApplications |
This file contains 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 | |
script | |
--resolver lts-9.1 | |
--package base | |
--package safe-exceptions | |
-} | |
{-# LANGUAGE TypeApplications #-} | |
import Control.Exception.Safe | |
import Control.Concurrent | |
main :: IO () | |
main = bracket_ (pure ()) (threadDelay 1000 >> putStrLn "text") (threadDelay 100500100500) | |
-- main = handleAny (putStrLn . mappend "caught " . show) (threadDelay 100500100500) | |
-- main = handleAsync @IO @SomeException (putStrLn . mappend "caught " . show) (threadDelay 100500100500) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment