Skip to content

Instantly share code, notes, and snippets.

@gromakovsky
Created February 26, 2018 20:32
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save gromakovsky/e55659aab6274b1ac338486e87d274c3 to your computer and use it in GitHub Desktop.
Save gromakovsky/e55659aab6274b1ac338486e87d274c3 to your computer and use it in GitHub Desktop.
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
#!/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