Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save savannidgerinel/9009e89a6ada716261ec8c65e7b59ce0 to your computer and use it in GitHub Desktop.
Save savannidgerinel/9009e89a6ada716261ec8c65e7b59ce0 to your computer and use it in GitHub Desktop.
Prelude ...> t <- forkIO $ catch (catchError (threadDelay 10000000 >> putStrLn "thread finished") (\err -> putStrLn $ "error detected: " <> show err)) (\(err :: AsyncException) -> putStrLn $ "async exception" <> show err)
Prelude ...> killThread t
asynPrelude ...> c exceptionthread killed
Prelude ...>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment