github-rest 1.0.1 → 1.0.2
raw patch · 4 files changed
+16/−14 lines, 4 filesdep ~aesondep ~http-clientdep ~unliftio-corePVP: major bump suggested
API removals or changes: PVP suggests a major version bump
Dependency ranges changed: aeson, http-client, unliftio-core
API changes (from Hackage documentation)
- GitHub.REST.Monad: instance (Control.Monad.IO.Class.MonadIO m, Control.Monad.Fail.MonadFail m) => GitHub.REST.Monad.Class.MonadGitHubREST (GitHub.REST.Monad.GitHubT m)
+ GitHub.REST.Monad: instance Control.Monad.IO.Class.MonadIO m => GitHub.REST.Monad.Class.MonadGitHubREST (GitHub.REST.Monad.GitHubT m)
- GitHub.REST: class MonadFail m => MonadGitHubREST m
+ GitHub.REST: class Monad m => MonadGitHubREST m
- GitHub.REST.Monad: class MonadFail m => MonadGitHubREST m
+ GitHub.REST.Monad: class Monad m => MonadGitHubREST m
- GitHub.REST.Monad.Class: class MonadFail m => MonadGitHubREST m
+ GitHub.REST.Monad.Class: class Monad m => MonadGitHubREST m
Files
- CHANGELOG.md +5/−0
- github-rest.cabal +4/−4
- src/GitHub/REST/Monad.hs +5/−5
- src/GitHub/REST/Monad/Class.hs +2/−5
CHANGELOG.md view
@@ -1,5 +1,10 @@ ## Upcoming +## 1.0.2++* Remove `MonadFail` constraint on `MonadGitHubREST`+* Support `unliftio-core-0.2.0.0`+ ## 1.0.1 Bundle test files in release tarball
github-rest.cabal view
@@ -4,10 +4,10 @@ -- -- see: https://github.com/sol/hpack ----- hash: 4abe6dbeeb9654d73d8b5fea26ceb219f87ff45d7eae72e404d7c00645bc92e2+-- hash: 231df145cc80e684a3c56624d1905d86e2c93e163e084a8afbe92e4ae1bc0d8f name: github-rest-version: 1.0.1+version: 1.0.2 synopsis: Query the GitHub REST API programmatically description: Query the GitHub REST API programmatically, which can provide a more flexible and clear interface than if all of the endpoints and their types@@ -59,7 +59,7 @@ , time >=1.8.0.2 && <1.10 , transformers >=0.5.2.0 && <0.6 , unliftio >=0.2.7.0 && <0.3- , unliftio-core >=0.1.1.0 && <0.2+ , unliftio-core >=0.1.1.0 && <0.3 if impl(ghc >= 8.0) ghc-options: -Wcompat -Wincomplete-record-updates -Wincomplete-uni-patterns -Wnoncanonical-monad-instances if impl(ghc < 8.8)@@ -99,7 +99,7 @@ , time >=1.8.0.2 && <1.10 , transformers >=0.5.2.0 && <0.6 , unliftio >=0.2.7.0 && <0.3- , unliftio-core >=0.1.1.0 && <0.2+ , unliftio-core >=0.1.1.0 && <0.3 if impl(ghc >= 8.0) ghc-options: -Wcompat -Wincomplete-record-updates -Wincomplete-uni-patterns -Wnoncanonical-monad-instances if impl(ghc < 8.8)
src/GitHub/REST/Monad.hs view
@@ -25,7 +25,7 @@ import Control.Monad.Fail (MonadFail) #endif import Control.Monad.IO.Class (MonadIO(..))-import Control.Monad.IO.Unlift (MonadUnliftIO(..), UnliftIO(..), withUnliftIO)+import Control.Monad.IO.Unlift (MonadUnliftIO(..)) import Control.Monad.Reader (ReaderT, ask, runReaderT) import Control.Monad.Trans (MonadTrans) import Data.Aeson (eitherDecode, encode)@@ -79,11 +79,11 @@ ) instance MonadUnliftIO m => MonadUnliftIO (GitHubT m) where- askUnliftIO = GitHubT $- withUnliftIO $ \u ->- return $ UnliftIO (unliftIO u . unGitHubT)+ withRunInIO inner = GitHubT $+ withRunInIO $ \run ->+ inner (run . unGitHubT) -instance (MonadIO m, MonadFail m) => MonadGitHubREST (GitHubT m) where+instance MonadIO m => MonadGitHubREST (GitHubT m) where queryGitHubPage' ghEndpoint = do (manager, GitHubState{..}) <- GitHubT ask
src/GitHub/REST/Monad/Class.hs view
@@ -14,9 +14,6 @@ ) where import Control.Monad (void, (<=<))-#if !MIN_VERSION_base(4,13,0)-import Control.Monad.Fail (MonadFail)-#endif import Control.Monad.Trans.Class (lift) import Control.Monad.Trans.Except (ExceptT) import Control.Monad.Trans.Identity (IdentityT)@@ -68,7 +65,7 @@ -- > ] -- > , ghData = [] -- > }-class MonadFail m => MonadGitHubREST m where+class Monad m => MonadGitHubREST m where {-# MINIMAL queryGitHubPage' #-} -- | Query GitHub, returning @Right (payload, links)@ if successful, where @payload@ is the@@ -86,7 +83,7 @@ where fail' (message, response) = let ellipses s = if Text.length s > 100 then take 100 (Text.unpack s) ++ "..." else Text.unpack s- in fail $ "Could not decode response:\nmessage = " ++ ellipses message ++ "\nresponse = " ++ ellipses response+ in error $ "Could not decode response:\nmessage = " ++ ellipses message ++ "\nresponse = " ++ ellipses response -- | 'queryGitHubPage', except ignoring pagination links. queryGitHub :: FromJSON a => GHEndpoint -> m a