giphy-api 0.1.0.0 → 0.2.0.0
raw patch · 4 files changed
+34/−33 lines, 4 filesdep ~giphy-apiPVP ok
version bump matches the API change (PVP)
Dependency ranges changed: giphy-api
API changes (from Hackage documentation)
Files
- app/Sample.hs +0/−21
- changelog.md +10/−0
- giphy-api.cabal +19/−7
- src/Web/Giphy.hs +5/−5
− app/Sample.hs
@@ -1,21 +0,0 @@-{-# LANGUAGE OverloadedStrings #-}--module Sample where--import qualified Data.Text as T-import qualified Web.Giphy as Giphy--apiKey :: Giphy.Key-apiKey = Giphy.Key "dc6zaTOxFJmzC"--sample :: IO ()-sample = do- let config = Giphy.GiphyConfig apiKey- resp <- Giphy.runGiphy (app "puppies") config- print resp-- where- app :: T.Text -> Giphy.Giphy [Giphy.Gif]- app q = do- resp <- Giphy.search $ Giphy.Query q- return $ Giphy._searchItems resp
+ changelog.md view
@@ -0,0 +1,10 @@+# Changelog++## v0.2.0.0++- Make sample app optional via build flag `buildSample`. This dramatically+ reduces the dependency graph.++## v0.1.0.0++- Initial release
giphy-api.cabal view
@@ -1,5 +1,5 @@ name: giphy-api-version: 0.1.0.0+version: 0.2.0.0 cabal-version: >=1.10 build-type: Simple license: BSD3@@ -11,7 +11,14 @@ Please see README.md category: Web author: Pascal Hartig+extra-source-files:+ changelog.md +flag buildsample+ description:+ Build the sample application.+ default: False+ library exposed-modules: Web.Giphy@@ -34,18 +41,23 @@ ghc-options: -Wall -fwarn-tabs -fwarn-incomplete-record-updates -fwarn-monomorphism-restriction -fwarn-unused-do-bind executable giphy-search+ + if flag(buildsample)+ build-depends:+ giphy-api <0.3,+ lens <4.14,+ optparse-applicative <0.13+ else+ buildable: False main-is: Main.hs build-depends: base >=4.7 && <5, text <1.3,- network-uri <2.7,- giphy-api <0.2,- lens <4.14,- optparse-applicative <0.13+ network-uri <2.7 default-language: Haskell2010 hs-source-dirs: app other-modules:- Sample+ Paths_giphy_api ghc-options: -Wall -fwarn-tabs -fwarn-incomplete-record-updates -fwarn-monomorphism-restriction -fwarn-unused-do-bind -threaded -rtsopts -with-rtsopts=-N test-suite spec@@ -55,7 +67,7 @@ base >=4.7 && <5, text <1.3, network-uri <2.7,- giphy-api <0.2,+ giphy-api <0.3, aeson <0.10, basic-prelude <0.6, bytestring <0.11,
src/Web/Giphy.hs view
@@ -345,7 +345,7 @@ -- -- | Issue a search request for the given query without specifying an offset.--- E.g. <http://api.giphy.com/v1/gifs/search?q=funny+cat&api_key=dc6zaTOxFJmzC>+-- E.g. <https://api.giphy.com/v1/gifs/search?q=funny+cat&api_key=dc6zaTOxFJmzC> search :: Query -> Giphy SearchResponse@@ -355,7 +355,7 @@ -- | Issue a search request for the given query by specifying a -- pagination offset.--- E.g. <http://api.giphy.com/v1/gifs/search?q=funny+cat&api_key=dc6zaTOxFJmzC&offset=25>+-- E.g. <https://api.giphy.com/v1/gifs/search?q=funny+cat&api_key=dc6zaTOxFJmzC&offset=25> searchOffset :: Query -> PaginationOffset@@ -365,7 +365,7 @@ lift $ search' (pure key) (pure offset) (pure query) -- | Issue a request for a single GIF identified by its 'GifId'.--- E.g. <http://api.giphy.com/v1/gifs/feqkVgjJpYtjy?api_key=dc6zaTOxFJmzC>+-- E.g. <https://api.giphy.com/v1/gifs/feqkVgjJpYtjy?api_key=dc6zaTOxFJmzC> gif :: GifId -> Giphy SingleGifResponse@@ -374,7 +374,7 @@ lift $ gif' gifid (pure key) -- | Issue a translate request for a given phrase or term.--- E.g. <http://api.giphy.com/v1/gifs/translate?s=superman&api_key=dc6zaTOxFJmzC>+-- E.g. <https://api.giphy.com/v1/gifs/translate?s=superman&api_key=dc6zaTOxFJmzC> translate :: Phrase -> Giphy TranslateResponse@@ -383,7 +383,7 @@ lift $ translate' (pure key) (pure phrase) -- | Issue a request for a random GIF for the given (optional) tag.--- E.g. <http://api.giphy.com/v1/gifs/random?api_key=dc6zaTOxFJmzC&tag=american+psycho>+-- E.g. <https://api.giphy.com/v1/gifs/random?api_key=dc6zaTOxFJmzC&tag=american+psycho> random :: Maybe Tag -> Giphy RandomResponse