on master help sign in
Adjustments after merging #49
commit83db2cbd50180733038a0ce3a40e867b0b1ea796 authormrkkrp <markkarpov92@gmail.com> dateThu 2 Aug 2018, 12:49 (8 years ago) parent4c88598
2 files changed+13−5
CHANGELOG.md+4 Network/HTTP/Req.hs+9−5
CHANGELOG.md+4
@@ -1,3 +1,7 @@
1+## Req 1.2.0
2+
3+* Added the `parseUrl` function.
4+
15## Req 1.1.0
26
37* Added `customAuth` and `attachHeader` to facilitate creation of custom
Network/HTTP/Req.hs+9−5
@@ -799,7 +799,7 @@ instance HttpMethod method => RequestComponent (Womb "method" method) where
799799-- $url
800800--
801801-- We use 'Url's which are correct by construction, see 'Url'. To build a
802−-- 'Url' from a 'ByteString', use 'parseUrlHttp', 'parseUrlHttps' or
802+-- 'Url' from a 'ByteString', use 'parseUrlHttp', 'parseUrlHttps', or
803803-- generic 'parseUrl'.
804804
805805-- | Request's 'Url'. Start constructing your 'Url' with 'http' or 'https'
@@ -886,11 +886,15 @@ parseUrlHttps url' = do
886886 (host :| path, option) <- parseUrlHelper url
887887 return (foldl (/:) (https host) path, option)
888888
889−-- | 'parseUrlHttp' and 'parseUrlHttps' companion that can be used
890−-- when scheme is not known beforehand.
889+-- | A more general URI parsing function that can be used when scheme is not
890+-- known beforehand.
891+--
892+-- @since 1.2.0
891893
892−parseUrl :: ByteString -> Maybe (Either (Url 'Http, Option scheme) (Url 'Https, Option scheme))
893−parseUrl url' = Left <$> parseUrlHttp url' <|> Right <$> parseUrlHttps url'
894+parseUrl
895+ :: ByteString
896+ -> Maybe (Either (Url 'Http, Option scheme) (Url 'Https, Option scheme))
897+parseUrl url = Left <$> parseUrlHttp url <|> Right <$> parseUrlHttps url
894898
895899-- | Get host\/collection of path pieces and possibly query parameters
896900-- already converted to 'Option'. This function is not public.