Created
August 6, 2019 16:03
-
-
Save domenkozar/a886d7de4cefaaa8c8d3a5d7bff6b0e5 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
{-# LANGUAGE ScopedTypeVariables #-} | |
import GHC.Stack | |
import Control.Exception | |
import Data.Functor | |
g :: HasCallStack => IO Bool | |
g = throwIO $ SomeException $ userError "foo" | |
f :: HasCallStack => IO () | |
f = void $ g | |
main :: IO () | |
main = catch f $ \(exc :: SomeException) -> print $ prettyCallStack callStack |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment