aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--lib/Web/OpenWeatherMap/API.hs3
-rw-r--r--lib/Web/OpenWeatherMap/Client.hs6
-rw-r--r--openweathermap.cabal2
3 files changed, 4 insertions, 7 deletions
diff --git a/lib/Web/OpenWeatherMap/API.hs b/lib/Web/OpenWeatherMap/API.hs
index 0c1e282..757a6be 100644
--- a/lib/Web/OpenWeatherMap/API.hs
+++ b/lib/Web/OpenWeatherMap/API.hs
@@ -14,8 +14,7 @@ module Web.OpenWeatherMap.API (
import Data.Proxy (Proxy(..))
import Servant.API ((:>), (:<|>)(..), JSON, Get, QueryParam)
-import Servant.Client (client)
-import Servant.Common.Req (ClientM)
+import Servant.Client (ClientM, client)
import Web.OpenWeatherMap.Types.CurrentWeather (CurrentWeather)
diff --git a/lib/Web/OpenWeatherMap/Client.hs b/lib/Web/OpenWeatherMap/Client.hs
index 7804ef2..c3611ee 100644
--- a/lib/Web/OpenWeatherMap/Client.hs
+++ b/lib/Web/OpenWeatherMap/Client.hs
@@ -7,9 +7,7 @@ module Web.OpenWeatherMap.Client (
) where
import Network.HTTP.Client (newManager, defaultManagerSettings)
-import Servant.Client (ClientEnv(..), runClientM, ServantError)
-import Servant.Common.BaseUrl (BaseUrl(..), Scheme(..))
-import Servant.Common.Req (ClientM)
+import Servant.Client (BaseUrl(BaseUrl), ClientEnv, mkClientEnv, ClientM, Scheme(Http), ServantError, runClientM)
import Web.OpenWeatherMap.Types.CurrentWeather (CurrentWeather)
import qualified Web.OpenWeatherMap.API as API
@@ -40,7 +38,7 @@ api (Coord lat lon) = API.weatherByCoord (Just lat) (Just lon) . Just
defaultEnv :: IO ClientEnv
defaultEnv = do
manager <- newManager defaultManagerSettings
- return $ ClientEnv manager baseUrl
+ return $ mkClientEnv manager baseUrl
-- XXX openweathermap.org does not support HTTPS,
-- XXX appid is passed in clear text. Oops.
diff --git a/openweathermap.cabal b/openweathermap.cabal
index dca75ca..4565f71 100644
--- a/openweathermap.cabal
+++ b/openweathermap.cabal
@@ -30,7 +30,7 @@ library
, aeson
, http-client
, servant
- , servant-client >= 0.9
+ , servant-client >= 0.13
exposed-modules:
Web.OpenWeatherMap.API
Web.OpenWeatherMap.Client