on master help sign in
A few minor improvements to the docs
4c65741mrkkrp
Network/HTTP/Req.hs+16−16
@@ -427,7 +427,7 @@ req method url body Proxy options = do
427-- A note about safety, in case 'unsafePerformIO' looks suspicious to you.
427-- A note about safety, in case 'unsafePerformIO' looks suspicious to you.
428-- The value of 'globalManager' is named and lives on top level. This means
428-- The value of 'globalManager' is named and lives on top level. This means
429-- it will be shared, i.e. computed only once on first use of manager. From
429-- it will be shared, i.e. computed only once on first use of manager. From
430−-- that moment on the 'IORef' will be just reused — exactly the behaviour we
430+-- that moment on the 'IORef' will be just reused — exactly the behavior we
431-- want here in order to maximize connection sharing. GHC could spoil the
431-- want here in order to maximize connection sharing. GHC could spoil the
432-- plan by inlining the definition, hence the @NOINLINE@ pragma.
432-- plan by inlining the definition, hence the @NOINLINE@ pragma.
433
433
@@ -924,8 +924,8 @@ type family ProvidesBody body :: CanHaveBody where
924-- 'CanHaveBody'. When method says it should have 'NoBody', the only body
924-- 'CanHaveBody'. When method says it should have 'NoBody', the only body
925-- option to use is 'NoReqBody'.
925-- option to use is 'NoReqBody'.
926--
926--
927−-- __Note__: users of GHC 8.0.1 will see slightly more friendly error
927+-- __Note__: users of GHC 8.0.1 and later will see a slightly more friendly
928−-- messages when method does not allow a body and body is provided.
928+-- error message when method does not allow a body and body is provided.
929
929
930type family HttpBodyAllowed
930type family HttpBodyAllowed
931 (allowsBody :: CanHaveBody)
931 (allowsBody :: CanHaveBody)
@@ -1101,12 +1101,12 @@ cookieJar jar = withRequest $ \x ->
1101
1101
1102-- $authentication
1102-- $authentication
1103--
1103--
1104−-- This section provides common authentication helpers in form of 'Option's.
1104+-- This section provides the common authentication helpers in the form of
1105−-- You should always prefer the provided authentication 'Option's to manual
1105+-- 'Option's. You should always prefer the provided authentication 'Option's
1106−-- construction of headers because it ensures that you only use one
1106+-- to manual construction of headers because it ensures that you only use
1107−-- authentication method at a time (they overwrite each other) and provides
1107+-- one authentication method at a time (they overwrite each other) and
1108−-- additional type safety that prevents leaking of credentials in cases when
1108+-- provides additional type safety that prevents leaking of credentials in
1109−-- authentication relies on TLS for encrypting sensitive data.
1109+-- cases when authentication relies on TLS for encrypting sensitive data.
1110
1110
1111-- | The 'Option' adds basic authentication.
1111-- | The 'Option' adds basic authentication.
1112--
1112--
@@ -1172,8 +1172,8 @@ oAuth2Token token = asFinalizer
1172-- Request — Optional parameters — Other
1172-- Request — Optional parameters — Other
1173
1173
1174-- | Specify the port to connect to explicitly. Normally, 'Url' you use
1174-- | Specify the port to connect to explicitly. Normally, 'Url' you use
1175−-- determines default port, @80@ for HTTP and @443@ for HTTPS, this 'Option'
1175+-- determines the default port: @80@ for HTTP and @443@ for HTTPS. This
1176−-- allows to choose arbitrary port overwriting the defaults.
1176+-- 'Option' allows to choose arbitrary port overwriting the defaults.
1177
1177
1178port :: Int -> Option scheme
1178port :: Int -> Option scheme
1179port n = withRequest $ \x ->
1179port n = withRequest $ \x ->
@@ -1196,8 +1196,8 @@ decompress
1196decompress f = withRequest $ \x ->
1196decompress f = withRequest $ \x ->
1197 x { L.decompress = f }
1197 x { L.decompress = f }
1198
1198
1199−-- | Specify number of microseconds to wait for response. Default is 30
1199+-- | Specify number of microseconds to wait for response. The default value
1200−-- seconds.
1200+-- is 30 seconds.
1201
1201
1202responseTimeout
1202responseTimeout
1203 :: Int -- ^ Number of microseconds to wait
1203 :: Int -- ^ Number of microseconds to wait
@@ -1205,7 +1205,7 @@ responseTimeout
1205responseTimeout n = withRequest $ \x ->
1205responseTimeout n = withRequest $ \x ->
1206 x { L.responseTimeout = LI.ResponseTimeoutMicro n }
1206 x { L.responseTimeout = LI.ResponseTimeoutMicro n }
1207
1207
1208−-- | HTTP version to send to server, default is HTTP 1.1.
1208+-- | HTTP version to send to server, the default is HTTP 1.1.
1209
1209
1210httpVersion
1210httpVersion
1211 :: Int -- ^ Major version number
1211 :: Int -- ^ Major version number
@@ -1409,12 +1409,12 @@ class RequestComponent a where
1409
1409
1410 getRequestMod :: a -> Endo L.Request
1410 getRequestMod :: a -> Endo L.Request
1411
1411
1412−-- | This wrapper is only used to attach a type-level tag to given type.
1412+-- | This wrapper is only used to attach a type-level tag to a given type.
1413-- This is necessary to define instances of 'RequestComponent' for any thing
1413-- This is necessary to define instances of 'RequestComponent' for any thing
1414-- that implements 'HttpMethod' or 'HttpBody'. Without the tag, GHC can't
1414-- that implements 'HttpMethod' or 'HttpBody'. Without the tag, GHC can't
1415-- see the difference between @'HttpMethod' method => 'RequestComponent'
1415-- see the difference between @'HttpMethod' method => 'RequestComponent'
1416-- method@ and @'HttpBody' body => 'RequestComponent' body@ when it decides
1416-- method@ and @'HttpBody' body => 'RequestComponent' body@ when it decides
1417−-- which instance to use (i.e. constraints are taken into account later,
1417+-- which instance to use (i.e. the constraints are taken into account later,
1418-- when instance is already chosen).
1418-- when instance is already chosen).
1419
1419
1420newtype Womb (tag :: Symbol) a = Womb a
1420newtype Womb (tag :: Symbol) a = Womb a