forecast-io-0.2.0.0: A Haskell library for working with forecast.io data.

Copyright(c) 2015 Devan Stormont
LicenseBSD-style
Maintainerstormont@gmail.com
Stabilityexperimental
PortabilityGHC
Safe HaskellNone
LanguageHaskell2010

ForecastIO.V2.URI

Description

This module builds a URI endpoint which can be used to download data from Forecast.io.

For official documentation, see: Forecast.io, version 2. Please start with this documentation for information about the general service; it's quite detailed.

The usage of this module is quite simple. For example, to get an endpoint for London:

buildUri $ mkForecastEndpoint { feCoord = GPS 51.5072 0.1275, feApiKey = "YOUR-API-KEY" }

General usage is to generate a URI of the form: https://api.forecast.io/forecast/APIKEY/LATITUDE,LONGITUDE

Synopsis

Documentation

class Endpoint a where Source

A class that can generate a URI endpoint from an instance of type a.

Methods

buildUri :: a -> Text Source

Builds the URI from the a instance.

data Exclude Source

A definition for a data segment to exclude from the results. If everything is excluded, little useful data will be returned.

data ForecastEndpoint Source

A data type for defining a Forecast.io endpoint.

The supported list of languages is defined by the forecast.io documentation.

The feExtend record, when set, will cause a more fine-grained request URI for hourly weather forecast data to be generated.

data GPS Source

A class that contains GPS data about a location.

Constructors

GPS 

Instances

data Units Source

Defines the units in which the data is returned in. Units_US is the default behavior when omitted.

Instances

mkForecastEndpoint :: ForecastEndpoint Source

Generates a default ForecastEndpoint object. At a minimum, you'll want to override the feCoord and feApiKey records.