http-query 0.1.3 → 0.1.3.1
raw patch · 4 files changed
+16/−12 lines, 4 filesPVP ok
version bump matches the API change (PVP)
API changes (from Hackage documentation)
Files
- ChangeLog.md +3/−0
- README.md +5/−5
- http-query.cabal +2/−2
- src/Network/HTTP/Query.hs +6/−5
ChangeLog.md view
@@ -1,5 +1,8 @@ # Revision history for http-query +## 0.1.3.1 (2026-02-08)+- update to safer +/+ without head and last+ ## 0.1.3 (2022-02-17) - new withURLQuery setup function
README.md view
@@ -9,12 +9,12 @@ ## Examples -A few projects use http-query already:+Some projects that use http-query: -- <https://hackage.haskell.org/package/cached-json-file>-- <https://hackage.haskell.org/package/fbrnch>-- <https://hackage.haskell.org/package/stack-all> - <https://hackage.haskell.org/package/bodhi>+- <https://hackage.haskell.org/package/cabal-rpm>+- <https://hackage.haskell.org/package/cached-json-file> - <https://hackage.haskell.org/package/copr-api>+- <https://hackage.haskell.org/package/fbrnch> - <https://hackage.haskell.org/package/pagure>-- <https://hackage.haskell.org/package/pdc>+- <https://hackage.haskell.org/package/stack-all>
http-query.cabal view
@@ -1,5 +1,5 @@ name: http-query-version: 0.1.3+version: 0.1.3.1 synopsis: Simple http queries description: Simple web API queries returning JSON.@@ -7,7 +7,7 @@ license-file: LICENSE author: Jens Petersen <juhpetersen@gmail.com> maintainer: Jens Petersen <juhpetersen@gmail.com>-copyright: 2020-2022 Jens Petersen <juhpetersen@gmail.com>+copyright: 2020-2022,2025-2026 Jens Petersen <juhpetersen@gmail.com> category: Web homepage: https://github.com/juhp/http-query bug-reports: https://github.com/juhp/http-query/issues
src/Network/HTTP/Query.hs view
@@ -52,6 +52,7 @@ import Data.ByteString (ByteString) #endif import qualified Data.ByteString.Char8 as B+import qualified Data.List as L import Data.Text (Text) import Network.HTTP.Client.Conduit import Network.HTTP.Simple@@ -84,11 +85,11 @@ -- > "abc" +/+ "/def" == "abc/def" infixr 5 +/+ (+/+) :: String -> String -> String-"" +/+ s = s-s +/+ "" = s-s +/+ t | last s == '/' = s ++ t- | head t == '/' = s ++ t-s +/+ t = s ++ '/' : t+s +/+ t =+ case (s,t) of+ ("",_) -> t+ (_,"") -> s+ (_,_) -> L.dropWhileEnd (== '/') s ++ '/' : L.dropWhile (== '/') t -- | Sets up an API request for some action withURLQuery :: String -> Query -> (Request -> a) -> a