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