pinboard 0.10.0.2 → 0.10.1.2
raw patch · 4 files changed
+19/−14 lines, 4 filesdep ~containersPVP: major bump suggested
API removals or changes: PVP suggests a major version bump
Dependency ranges changed: containers
API changes (from Hackage documentation)
- Pinboard.Client: checkStatusCodeResponse :: Response a -> Either PinboardError ()
+ Pinboard.Client: checkStatusCodeResponse :: Response ByteString -> Either PinboardError ()
Files
- changelog.md +4/−0
- pinboard.cabal +4/−4
- src/Pinboard/Api.hs +2/−2
- src/Pinboard/Client.hs +9/−8
changelog.md view
@@ -1,3 +1,7 @@+__v0.10.1.2++update to ghc 8.6; update containers+ __v0.10.0.0 refactor; use UnliftIO; remove MonadError/MonadErrorPinboard; remove ExceptT from PinboardT
pinboard.cabal view
@@ -2,10 +2,10 @@ -- -- see: https://github.com/sol/hpack ----- hash: bf527a9a3fada60d79dac953824902ac4fd1ca4ed0c7bdb908be52c8c54dcb2b+-- hash: 1698c9dd781d3bc7c6f7fc878041c9a778c65a6418c5a7759b1a57f46efc35f8 name: pinboard-version: 0.10.0.2+version: 0.10.1.2 synopsis: Access to the Pinboard API description: . The Pinboard API is a way to interact programatically with@@ -38,13 +38,13 @@ aeson >=0.11.1 && <2.0 , base >=4.6 && <5.0 , bytestring >=0.10.0 && <0.11- , containers >=0.5.0.0 && <0.6+ , containers >=0.5.0.0 && <0.7 , http-client >=0.5 && <0.6 , http-client-tls >=0.3.0 && <0.4 , http-types >=0.8 && <0.13 , monad-logger >=0.3 && <0.4 , mtl >=2.2.1- , network >=2.6.2 && <2.8+ , network >=2.6.2 && <2.9 , profunctors >=5 , random >=1.1 , text >=0.11 && <1.3
src/Pinboard/Api.hs view
@@ -182,10 +182,10 @@ getNoteList :: MonadPinboard m => m (Either PinboardError NoteList)-getNoteList = pinboardJson $ getNoteListRequest FormatJson+getNoteList = pinboardJson (getNoteListRequest FormatJson) -- | notes/id : Returns an individual user note. The hash property is a 20 character long sha1 hash of the note text. getNote :: MonadPinboard m => NoteId -> m (Either PinboardError Note)-getNote noteid = pinboardJson $ getNoteRequest FormatJson noteid+getNote noteid = pinboardJson (getNoteRequest FormatJson noteid)
src/Pinboard/Client.hs view
@@ -60,7 +60,6 @@ import Data.Monoid ((<>)) import Data.Aeson (FromJSON, eitherDecodeStrict') -import Network (withSocketsDo) import Network.HTTP.Types (urlEncode) import Network.HTTP.Types.Status (statusCode) @@ -86,6 +85,8 @@ import Data.IORef import Data.Time.Clock import Data.Time.Calendar+import Data.Bifunctor+import Data.Function import Control.Applicative import Prelude@@ -226,10 +227,8 @@ :: FromJSON a => Response LBS.ByteString -> Either PinboardError a parseJSONResponse response =- either- (Left . addErrMsg (toText (responseBody response)))- (const $ decodeJSONResponse (responseBody response))- (checkStatusCodeResponse response)+ checkStatusCodeResponse response+ *> decodeJSONResponse (responseBody response) decodeJSONResponse :: FromJSON a@@ -240,8 +239,10 @@ -------------------------------------------------------------------------------- checkStatusCodeResponse- :: Response a -> Either PinboardError ()-checkStatusCodeResponse = checkStatusCode . statusCode . responseStatus+ :: Response LBS.ByteString -> Either PinboardError ()+checkStatusCodeResponse resp =+ (checkStatusCode . statusCode . responseStatus) resp+ & (first . addErrMsg . toText . responseBody) resp checkStatusCode :: Int -> Either PinboardError ()@@ -280,7 +281,7 @@ -------------------------------------------------------------------------------- newMgr :: IO Manager newMgr =- withSocketsDo . newManager $ managerSetProxy (proxyEnvironment Nothing) tlsManagerSettings+ newManager $ managerSetProxy (proxyEnvironment Nothing) tlsManagerSettings mgrFail :: (Monad m)