Created
November 8, 2019 16:30
-
-
Save fghibellini/0da00bdfb95b48d87485cba3e5b95c11 to your computer and use it in GitHub Desktop.
ghc stacktraces
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 RankNTypes #-} | |
import Control.Monad (forM_) | |
import GHC.Stack | |
httpCall :: HasCallStack => IO () | |
httpCall = do | |
putStrLn $ prettyCallStack $ callStack | |
print "http resolved" | |
retry :: HasCallStack => (HasCallStack => IO()) -> IO () | |
retry op = do | |
forM_ [1] $ \i -> do | |
op | |
main = retry httpCall |
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
GHCi, version 8.6.5 | |
CallStack (from HasCallStack): | |
httpCall, called at main.hs:16:14 in main:Main | |
op, called at main.hs:14:5 in main:Main | |
retry, called at main.hs:16:8 in main:Main | |
"http resolved" | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment