Created
November 11, 2019 20:48
-
-
Save fghibellini/680c45e4a6660e00a0a697fb742502da to your computer and use it in GitHub Desktop.
HasCallStack with argument
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 => String -> IO () | |
httpCall url = do | |
putStrLn $ prettyCallStack callStack | |
print $ "GET " <> url <> " resolved" | |
retry :: HasCallStack => (HasCallStack => a -> IO()) -> a -> IO () | |
retry op arg = | |
forM_ [1] $ \i -> | |
op arg | |
main :: IO () | |
main = retry httpCall "/users" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment