modern-uri 0.1.1.0 → 0.1.1.1
raw patch · 5 files changed
+28/−9 lines, 5 filesPVP ok
version bump matches the API change (PVP)
API changes (from Hackage documentation)
Files
- CHANGELOG.md +4/−0
- Text/URI.hs +13/−0
- Text/URI/Lens.hs +6/−6
- Text/URI/Parser/Text.hs +4/−2
- modern-uri.cabal +1/−1
CHANGELOG.md view
@@ -1,3 +1,7 @@+## Modern URI 0.1.1.1++* Fixed implementation of `Text.URI.Lens.queryParam` traversal.+ ## Modern URI 0.1.1.0 * Derived `NFData` for `ParseException`.
Text/URI.hs view
@@ -45,9 +45,11 @@ , unRText , RTextException (..) -- * Parsing+ -- $parsing , parser , parserBs -- * Rendering+ -- $rendering , render , render' , renderBs@@ -75,3 +77,14 @@ -- it rejects it by throwing the 'RTextException'. Remember that the 'Maybe' -- datatype is also an instance of 'Control.Monad.Catch.MonadThrow', and so -- one could as well use the smart constructors in the 'Maybe' monad.++-- $parsing+--+-- The input you feed into the parsers must be a valid URI as per RFC 3986,+-- that is, its components should be percent-encoded where necessary.++-- $rendering+--+-- Rendering functions take care of constructing correct 'URI'+-- representation as per RFC 3986, that is, percent-encoding will be applied+-- when necessary automatically.
Text/URI/Lens.hs view
@@ -131,13 +131,13 @@ -- return\/modify several items at once. queryParam :: RText 'QueryKey -> Traversal' [URI.QueryParam] (RText 'QueryValue)-queryParam k f s = go s+queryParam k f = traverse g where- go [] = pure s- go (x:xs) =- case x of- QueryParam k' v -> if k == k' then f v *> go xs else go xs- _ -> go xs+ g p@(QueryParam k' v) =+ if k == k'+ then QueryParam k' <$> f v+ else pure p+ g p = pure p -- | A getter that can project 'Text' from refined text values.
Text/URI/Parser/Text.hs view
@@ -35,8 +35,10 @@ import qualified Data.Text.Encoding as TE import qualified Text.Megaparsec.Char.Lexer as L --- | Construct a 'URI' from 'Text'. In case of failure 'ParseException' is--- thrown.+-- | Construct a 'URI' from 'Text'. The input you pass to 'mkURI' must be a+-- valid URI as per RFC 3986, that is, its components should be+-- percent-encoded where necessary. In case of parse failure+-- 'ParseException' is thrown. -- -- This function uses the 'parser' parser under the hood, which you can also -- use directly in a Megaparsec parser.
modern-uri.cabal view
@@ -1,5 +1,5 @@ name: modern-uri-version: 0.1.1.0+version: 0.1.1.1 cabal-version: >= 1.18 tested-with: GHC==7.10.3, GHC==8.0.2, GHC==8.2.1 license: BSD3