If you don't care about the exception value it's totally fine to use _
but you'll need to use ScopedTypeVariables
or a let clause to specify the type you want.
{-# LANGUAGE ScopedTypeVariables #-}
retryOnTimeout :: IO a -> IO a
retryOnTimeout action = catch action $ \ (_ :: HttpException) -> do
putStrLn "Timed out. Trying again."
threadDelay 5000000
action