weather-api-0.4.3.3: Weather API implemented in Haskell

Safe HaskellNone
LanguageHaskell2010

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 ApiResponse Source #

Retrieve weather using existing handler

getWeather' :: Config -> String -> IO ApiResponse Source #

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