packages feed

curl-aeson 0.1.0.1 → 0.1.0.2

raw patch · 3 files changed

+14/−8 lines, 3 files

Files

curl-aeson.cabal view
@@ -1,10 +1,9 @@ cabal-version:       >=1.10 name:                curl-aeson-version:             0.1.0.1+version:             0.1.0.2 synopsis:            Communicate with web services using JSON  description:         A library for communicating with JSON over HTTP(S)                      or any other protocols supported by cURL.-                     connection.                      .                      Supports rich set of connectivity                      features provided by libcurl combined to the
src/Network/Curl/Aeson.hs view
@@ -1,4 +1,4 @@-{-# LANGUAGE RecordWildCards #-}+{-# LANGUAGE CPP, RecordWildCards #-} -- | -- Module    : Network.Curl.Aeson -- Copyright : (c) 2013-2022, Joel Lehtonen@@ -54,6 +54,11 @@ import Network.Curl import Network.Curl.Aeson.Internal +#if !MIN_VERSION_aeson(2,0,0)+-- Backwards compatibility with older versions of aeson library+type Key = Text+#endif+ -- | Shorthand for doing just a HTTP GET request and parsing the output to -- any 'FromJSON' instance. curlAesonGet :: (FromJSON a)@@ -187,7 +192,7 @@ -- -- In this example we are parsing JSON from -- <http://json.org/example.html>.  Note the use of the--- @OverloadedStrings@ language extension which enables 'Text' values+-- @OverloadedStrings@ language extension which enables 'Key' values -- to be written as string literals. -- -- @p ('Data.Aeson.Types.Internal.Object' o) = 'pure' o'...'\"glossary\"'...'\"title\"@@ -195,7 +200,7 @@ -- @ (...) :: FromJSON b          => Parser Object -- ^ Parser to JSON object to look into-         -> Text          -- ^ Key to look for+         -> Key           -- ^ Key to look for          -> Parser b      -- ^ Parser to the resulting field (...) p s = do   o <- p
src/Network/Curl/Aeson/Internal.hs view
@@ -1,6 +1,6 @@ {-# LANGUAGE OverloadedStrings #-} -- |--- Module    : Network.Curl.Aeson+-- Module    : Network.Curl.Aeson.Internal -- Copyright : (c) 2022, Joel Lehtonen -- License   : BSD3 --@@ -8,9 +8,11 @@ -- Stability : experimental -- Portability: portable ----- Internal support functions to get ByteString payload out of+-- Internal support functions to for uploading ByteString payload with -- libcurl.-module Network.Curl.Aeson.Internal where+module Network.Curl.Aeson.Internal ( mkReadFunction+                                   , mkReadFunctionLazy+                                   ) where  import Data.IORef import qualified Data.ByteString as B