on master help sign in
Add a recommendation where to define ‘MonadHttp’
c4e48b6mrkkrp
Network/HTTP/Req.hs+3
@@ -306,6 +306,9 @@ globalManager = unsafePerformIO $ do
306--
306--
307-- To use 'req' in your monad, all you need to do is to make the monad an
307-- To use 'req' in your monad, all you need to do is to make the monad an
308-- instance of the 'MonadHttp' type class.
308-- instance of the 'MonadHttp' type class.
309+--
310+-- When writing a library, keep your API polymorphic in terms of
311+-- 'MonadHttp', only define instance of 'MonadHttp' in final application.
309
312
310-- | A type class for monads that support performing HTTP requests.
313-- | A type class for monads that support performing HTTP requests.
311-- Typically, you only need to define the 'handleHttpException' method
314-- Typically, you only need to define the 'handleHttpException' method