mcschroeder / yelp Goto Github PK
View Code? Open in Web Editor NEWHaskell bindings for the Yelp API
License: BSD 3-Clause "New" or "Revised" License
Haskell bindings for the Yelp API
License: BSD 3-Clause "New" or "Revised" License
This patch updates yelp bindings to http-conduit 2.0.0.3
diff --git a/Web/Yelp/Base.hs b/Web/Yelp/Base.hs
index 3863331..f1e866e 100644
--- a/Web/Yelp/Base.hs
+++ b/Web/Yelp/Base.hs
@@ -20,6 +20,7 @@ import Data.ByteString (ByteString)
import Data.Text (Text)
import Data.Text.Encoding (encodeUtf8)
import Data.Typeable (Typeable)
+import Data.Default (def)
import qualified Control.Exception.Lifted as E
import qualified Data.Aeson as A
@@ -44,9 +45,9 @@ getObject path query =
runResourceInY $ asJson =<< yhttp =<< yreq path query
-- | A plain 'H.Request' to a Yelp API.
-yreq :: Monad m => Text -> HT.Query -> YelpT m (H.Request n)
+yreq :: Monad m => Text -> HT.Query -> YelpT m H.Request
yreq path query = return
- H.def { H.host = "api.yelp.com"
+ def { H.host = "api.yelp.com"
, H.path = encodeUtf8 path
, H.queryString = HT.renderQuery False query
, H.responseTimeout = Just 120000000 -- 2 minutes
@@ -55,7 +56,7 @@ yreq path query = return
-- | Same as 'H.http', but takes care of all the boilerplate
-- (such as signing the request and error handling).
yhttp :: (MonadBaseControl IO m, C.MonadResource m) =>
- H.Request m
+ H.Request
-> YelpT m (H.Response (C.ResumableSource m ByteString))
yhttp req = do
let req' = req { H.checkStatus = \_ _ _ -> Nothing }
diff --git a/yelp.cabal b/yelp.cabal
index 7f3d1c8..5fc3388 100644
--- a/yelp.cabal
+++ b/yelp.cabal
@@ -47,6 +47,7 @@ library
, transformers-base >= 0.4
, aeson >= 0.6
, attoparsec-conduit >= 1.0
+ , data-default
extensions:
GeneralizedNewtypeDeriving
FlexibleInstances
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.