weather-api-0.4.1: Weather api implemented in haskell

Safe HaskellNone

WeatherApi

Description

Usage:

required imports

 import WeatherApi
 import WeatherApi.Google

With handler in case server will alow you to make few requests with one connection

>>> let h = mkWeatherHandler $ initApi "en" "utf-8"
>>> getWeather h "moscow"
Right (Weather { tempF = 75.0
               , tempC = 24.0
               , humidity = "Humidity: 25%"
               , windCondition = "Wind: S at 16 mph"
               , condition = "Clear"
               })

Simple case

>>> getWeather' (initApi "en" "utf-8") "moscow"
Right (Weather { tempF = 75.0
               , tempC = 24.0
               , humidity = "Humidity: 25%"
               , windCondition = "Wind: S at 16 mph"
               , condition = "Clear"
               })

Synopsis

Documentation

getWeather :: WeatherApiHandler -> String -> IO ApiResponseSource

Retrieve weather using existing handler

getWeather' :: Config -> String -> IO ApiResponseSource

Retrieve weather using just config It's usefull when you don't need one connection for few requests