@@ -323,40 +323,29 @@ spec = do
323323instance MonadHttp IO where
324324 handleHttpException = throwIO
325325
326−instance MonadHttp (ReaderT HttpConfig IO) where
327− handleHttpException = liftIO . throwIO
328− getHttpConfig = ask
329−
330326----------------------------------------------------------------------------
331327-- Helpers
332328
333329-- | Run request with such settings that it does not signal error on adverse
334330-- response status codes.
335331
336−prepareForShit
337− :: ReaderT HttpConfig IO a
338− -> IO a
339−prepareForShit m = runReaderT m def { httpConfigCheckResponse = noNoise }
332+prepareForShit :: Req a -> IO a
333+prepareForShit = runReq def { httpConfigCheckResponse = noNoise }
340334 where
341335 noNoise _ _ = return ()
342336
343337-- | Run request with such settings that it throws on any response.
344338
345−blindlyThrowing
346− :: ReaderT HttpConfig IO a
347− -> IO a
348−blindlyThrowing m = runReaderT m def { httpConfigCheckResponse = doit }
339+blindlyThrowing :: Req a -> IO a
340+blindlyThrowing = runReq def { httpConfigCheckResponse = doit }
349341 where
350342 doit _ _ = error "Oops!"
351343
352344-- | Run request with such settings that every retry increments the given
353345-- @'IORef' 'Int'@.
354346
355−countingRetries
356− :: IORef Int
357− -> ReaderT HttpConfig IO a
358− -> IO a
359−countingRetries nref m = runReaderT m def
347+countingRetries :: IORef Int -> Req a -> IO a
348+countingRetries nref = runReq def
360349 { httpConfigCheckResponse = noNoise
361350 , httpConfigRetryPolicy = R.constantDelay 50000 <> R.limitRetries 5
362351 , httpConfigRetryJudge = judge }