@@ -24,7 +24,7 @@
2424-- What does the phrase “easy-to-use” mean? It means that the library is
2525-- designed to be beginner-friendly so it's simple to add to your monad
2626-- stack, intuitive to work with, well-documented, and does not get in your
27−-- way. Doing HTTP requests is a common task and a Haskell library for this
27+-- way. Doing HTTP requests is a common task and Haskell library for this
2828-- should be very approachable and clear to beginners, thus certain
2929-- compromises were made. For example, one cannot currently modify
3030-- 'L.ManagerSettings' of the default manager because the library always
@@ -38,7 +38,7 @@
3838-- methods like 'GET' or 'OPTIONS', and the amount of implicit assumptions
3939-- is minimized by making the user specify his\/her intentions in an
4040-- explicit form (for example, it's not possible to avoid specifying the
41−-- body or method of a request). Authentication methods that assume HTTPS
41+-- body or method of request). Authentication methods that assume HTTPS
4242-- force the user to use HTTPS at the type level. The library also carefully
4343-- hides underlying types from the lower-level @http-client@ package because
4444-- those types are not safe enough (for example 'L.Request' is an instance
@@ -50,7 +50,7 @@
5050-- your own HTTP methods, create new ways to construct the body of a
5151-- request, create new authorization options, perform a request in a
5252-- different way, and create your own methods to parse and represent a
53−-- response. As a user extends the library to satisfy his\/her special
53+-- response. As the user extends the library to satisfy his\/her special
5454-- needs, the new solutions will work just like the built-ins. However, all
5555-- of the common cases are also covered by the library out-of-the-box.
5656--
@@ -61,7 +61,7 @@
6161-- applications. For example, some people prefer throwing exceptions, while
6262-- others are concerned with purity. Just define 'handleHttpException'
6363-- accordingly when making your monad instance of 'MonadHttp' and it will
64−-- play together seamlessly. Finally, the library cuts boilerplate down
64+-- play together seamlessly. Finally, the library cuts down boilerplate
6565-- considerably, and helps you write concise, easy to read, and maintainable
6666-- code.
6767--
@@ -118,7 +118,7 @@ module Network.HTTP.Req
118118 , reqBr
119119 , req'
120120 , withReqManager
121− -- * Embedding requests into your monad
121+ -- * Embedding requests in your monad
122122 -- $embedding-requests
123123 , MonadHttp (..)
124124 , HttpConfig (..)
@@ -517,7 +517,7 @@ globalManager = unsafePerformIO $ do
517517{-# NOINLINE globalManager #-}
518518
519519----------------------------------------------------------------------------
520−-- Embedding requests into your monad
520+-- Embedding requests in your monad
521521
522522-- $embedding-requests
523523--
@@ -526,7 +526,7 @@ globalManager = unsafePerformIO $ do
526526--
527527-- When writing a library, keep your API polymorphic in terms of
528528-- 'MonadHttp', only define instance of 'MonadHttp' in final application.
529−-- Another option is to use @newtype@ wrapped monad stack and define
529+-- Another option is to use a @newtype@-wrapped monad stack and define
530530-- 'MonadHttp' for it. As of version /0.4.0/, the 'Req' monad that follows
531531-- this strategy is provided out-of-the-box (see below).
532532
@@ -779,9 +779,9 @@ instance HttpMethod PATCH where
779779class HttpMethod a where
780780
781781 -- | Type function 'AllowsBody' returns a type of kind 'CanHaveBody' which
782− -- tells the rest of the library whether the method can have a body or
783− -- not. We use the special type 'CanHaveBody' lifted to the kind level
784− -- instead of 'Bool' to get more user-friendly compiler messages.
782+ -- tells the rest of the library whether the method can have body or not.
783+ -- We use the special type 'CanHaveBody' lifted to the kind level instead
784+ -- of 'Bool' to get more user-friendly compiler messages.
785785
786786 type AllowsBody a :: CanHaveBody
787787
@@ -835,13 +835,13 @@ data Url (scheme :: Scheme) = Url Scheme (NonEmpty Text)
835835 -- NOTE The second value is the path segments in reversed order.
836836 deriving (Eq, Ord, Show, Data, Typeable, Generic)
837837
838−-- | Given host name, produce a 'Url' which have “http” as its scheme and
838+-- | Given host name, produce a 'Url' which has “http” as its scheme and
839839-- empty path. This also sets port to @80@.
840840
841841http :: Text -> Url 'Http
842842http = Url Http . pure
843843
844−-- | Given host name, produce a 'Url' which have “https” as its scheme and
844+-- | Given host name, produce a 'Url' which has “https” as its scheme and
845845-- empty path. This also sets port to @443@.
846846
847847https :: Text -> Url 'Https
@@ -871,6 +871,8 @@ infixl 5 /:
871871-- This function only parses 'Url' (scheme, host, path) and optional query
872872-- parameters that are returned as 'Option'. It does not parse method name
873873-- or authentication info from given 'ByteString'.
874+--
875+-- This function expected scheme to be “http”.
874876
875877parseUrlHttp :: ByteString -> Maybe (Url 'Http, Option scheme)
876878parseUrlHttp url' = do
@@ -878,7 +880,7 @@ parseUrlHttp url' = do
878880 (host :| path, option) <- parseUrlHelper url
879881 return (foldl (/:) (http host) path, option)
880882
881−-- | Just like 'parseUrlHttp', but expects “https” scheme.
883+-- | Just like 'parseUrlHttp', but expects the “https” scheme.
882884
883885parseUrlHttps :: ByteString -> Maybe (Url 'Https, Option scheme)
884886parseUrlHttps url' = do
@@ -933,8 +935,9 @@ instance RequestComponent (Url scheme) where
933935--
934936-- A number of options for request bodies are available. The @Content-Type@
935937-- header is set for you automatically according to the body option you use
936−-- (it's always specified in documentation for a given body option). To add
937−-- your own way to represent request body, define an instance of 'HttpBody'.
938+-- (it's always specified in the documentation for a given body option). To
939+-- add your own way to represent request body, define an instance of
940+-- 'HttpBody'.
938941
939942-- | This data type represents empty body of an HTTP request. This is the
940943-- data type to use with 'HttpMethod's that cannot have a body, as it's the
@@ -1072,16 +1075,16 @@ class HttpBody body where
10721075
10731076 getRequestBody :: body -> L.RequestBody
10741077
1075− -- | This method allows to optionally specify value of @Content-Type@
1076− -- header that should be used with particular body option. By default it
1077− -- returns 'Nothing' and so @Content-Type@ is not set.
1078+ -- | This method allows us to optionally specify the value of
1079+ -- @Content-Type@ header that should be used with particular body option.
1080+ -- By default it returns 'Nothing' and so @Content-Type@ is not set.
10781081
10791082 getRequestContentType :: body -> Maybe ByteString
10801083 getRequestContentType = const Nothing
10811084
10821085-- | The type function recognizes 'NoReqBody' as having 'NoBody', while any
1083−-- other body option 'CanHaveBody'. This forces user to use 'NoReqBody' with
1084−-- 'GET' method and other methods that should not send a body.
1086+-- other body option 'CanHaveBody'. This forces the user to use 'NoReqBody'
1087+-- with 'GET' method and other methods that should not have body.
10851088
10861089type family ProvidesBody body :: CanHaveBody where
10871090 ProvidesBody NoReqBody = 'NoBody
@@ -1119,7 +1122,7 @@ instance HttpBody body => RequestComponent (Womb "body" body) where
11191122
11201123-- $optional-parameters
11211124--
1122−-- Optional parameters to a request include things like query parameters,
1125+-- Optional parameters of request include things like query parameters,
11231126-- headers, port number, etc. All optional parameters have the type
11241127-- 'Option', which is a 'Monoid'. This means that you can use 'mempty' as
11251128-- the last argument of 'req' to specify no optional parameters, or combine
@@ -1236,8 +1239,7 @@ header
12361239 -> Option scheme
12371240header name value = withRequest (attachHeader name value)
12381241
1239−-- | A non-public helper that attaches a header with given name and content
1240−-- to a 'L.Request'.
1242+-- | Attach a header with given name and content to a 'L.Request'.
12411243--
12421244-- @since 1.1.0
12431245
@@ -1285,7 +1287,7 @@ basicAuth
12851287basicAuth = basicAuthUnsafe
12861288
12871289-- | An alternative to 'basicAuth' which works for any scheme. Note that
1288−-- using basic access authentication without SSL/TLS is vulnerable to
1290+-- using basic access authentication without SSL\/TLS is vulnerable to
12891291-- attacks. Use 'basicAuth' instead unless you know what you are doing.
12901292--
12911293-- @since 0.3.1