@@ -128,6 +128,7 @@ module Network.HTTP.Req
128128 , Url
129129 , http
130130 , https
131+ , (/~)
131132 , (/:)
132133 , parseUrlHttp
133134 , parseUrlHttps
@@ -502,12 +503,13 @@ instance HttpMethod method => RequestComponent (Womb "method" method) where
502503-- 'Url' from 'ByteString', use 'parseUrlHttp' or 'parseUrlHttps'.
503504
504505-- | Request's 'Url'. Start constructing your 'Url' with 'http' or 'https'
505−-- specifying the scheme and host at the same time. Then use the @('/:')@
506−-- operator to grow path one piece at a time. Every single piece of path
507−-- will be url(percent)-encoded, so @('/:')@ is the only way to have forward
508−-- slashes between path segments. This approach makes working with dynamic
509−-- path segments easy and safe. See examples below how to represent various
510−-- 'Url's (make sure the @OverloadedStrings@ language extension is enabled).
506+-- specifying the scheme and host at the same time. Then use the @('/~')@
507+-- and @('/:')@ operators to grow path one piece at a time. Every single
508+-- piece of path will be url(percent)-encoded, so @('/:')@ is the only way
509+-- to have forward slashes between path segments. This approach makes
510+-- working with dynamic path segments easy and safe. See examples below how
511+-- to represent various 'Url's (make sure the @OverloadedStrings@ language
512+-- extension is enabled).
511513--
512514-- ==== __Examples__
513515--
@@ -523,7 +525,7 @@ instance HttpMethod method => RequestComponent (Womb "method" method) where
523525-- > https "httpbin.org" /: "foo" /: "bar/baz"
524526-- > -- https://httpbin.org/foo/bar%2Fbaz
525527--
526−-- > https "httpbin.org" /: "bytes" /: (10 :: Int)
528+-- > https "httpbin.org" /: "bytes" /~ (10 :: Int)
527529-- > -- https://httpbin.org/bytes/10
528530--
529531-- > https "юникод.рф"
@@ -548,9 +550,16 @@ https = Url Https . pure
548550-- | Grow given 'Url' appending a single path segment to it. Note that the
549551-- path segment can be of any type that is an instance of 'ToHttpApiData'.
550552
553+infixl 5 /~
554+(/~) :: ToHttpApiData a => Url scheme -> a -> Url scheme
555+Url secure path /~ segment = Url secure (NE.cons (toUrlPiece segment) path)
556+
557+-- | Type-constrained version of @('/~')@ to remove ambiguity in cases when
558+-- next URL piece is a 'Text' literal.
559+
551560infixl 5 /:
552−(/:) :: ToHttpApiData a => Url scheme -> a -> Url scheme
553−Url secure path /: segment = Url secure (NE.cons (toUrlPiece segment) path)
561+(/:) :: Url scheme -> Text -> Url scheme
562+(/:) = (/~)
554563
555564-- | The 'parseUrlHttp' function provides an alternative method to get 'Url'
556565-- (possibly with some 'Option's) from a 'ByteString'. This is useful when