forecast-io-0.1.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.Types

Description

This module defines data types for the various JSON types returned by the Forecast.io service.

These definitions are generally straight conversions from the original JSON. Use of the Forecast.io service should return JSON that can be directly decoded into a Forecast object:

eitherDecode json :: Either String Forecast

Some of the ByteString libraries seem not to parse certain unicode characters correctly (or maybe it's an Aeson problem; this hasn't yet been determined). If your decoding fails, you may need to filter out certain of these characters before decoding. In particular, the degree symbol (Unicode character \176) has been known to cause decoding errors.

Another thing to be wary of is that potentially any field is not guaranteed to be returned in the JSON. This effectively makes every definition live within a Maybe.

Synopsis

Documentation

data DataPoint Source

Defines a single data point in the weather forecast. For a full explanation of the various records, please consult the official documentation.

Constructors

DataPoint 

Fields

dataPoint_time :: Maybe Int
 
dataPoint_summary :: Maybe Text
 
dataPoint_icon :: Maybe Text
 
dataPoint_sunriseTime :: Maybe Int
 
dataPoint_sunsetTime :: Maybe Int
 
dataPoint_moonPhase :: Maybe Float
 
dataPoint_moonPhaseError :: Maybe Float
 
dataPoint_nearestStormDistance :: Maybe Float
 
dataPoint_nearestStormDistanceError :: Maybe Float
 
dataPoint_nearestStormBearing :: Maybe Float
 
dataPoint_nearestStormBearingError :: Maybe Float
 
dataPoint_precipIntensity :: Maybe Float
 
dataPoint_precipIntensityError :: Maybe Float
 
dataPoint_precipIntensityMax :: Maybe Float
 
dataPoint_precipIntensityMaxError :: Maybe Float
 
dataPoint_precipIntensityMaxTime :: Maybe Int
 
dataPoint_precipProbability :: Maybe Float
 
dataPoint_precipProbabilityError :: Maybe Float
 
dataPoint_precipType :: Maybe Text
 
dataPoint_precipAccumulation :: Maybe Float
 
dataPoint_precipAccumulationError :: Maybe Float
 
dataPoint_temperature :: Maybe Float
 
dataPoint_temperatureError :: Maybe Float
 
dataPoint_temperatureMin :: Maybe Float
 
dataPoint_temperatureMinError :: Maybe Float
 
dataPoint_temperatureMinTime :: Maybe Int
 
dataPoint_temperatureMax :: Maybe Float
 
dataPoint_temperatureMaxError :: Maybe Float
 
dataPoint_temperatureMaxTime :: Maybe Int
 
dataPoint_apparentTemperature :: Maybe Float
 
dataPoint_apparentTemperatureError :: Maybe Float
 
dataPoint_apparentTemperatureMin :: Maybe Float
 
dataPoint_apparentTemperatureMinError :: Maybe Float
 
dataPoint_apparentTemperatureMinTime :: Maybe Int
 
dataPoint_apparentTemperatureMax :: Maybe Float
 
dataPoint_apparentTemperatureMaxError :: Maybe Float
 
dataPoint_apparentTemperatureMaxTime :: Maybe Int
 
dataPoint_dewPoint :: Maybe Float
 
dataPoint_dewPointError :: Maybe Float
 
dataPoint_windSpeed :: Maybe Float
 
dataPoint_windSpeedError :: Maybe Float
 
dataPoint_windBearing :: Maybe Float
 
dataPoint_windBearingError :: Maybe Float
 
dataPoint_cloudCover :: Maybe Float
 
dataPoint_cloudCoverError :: Maybe Float
 
dataPoint_humidity :: Maybe Float
 
dataPoint_humidityError :: Maybe Float
 
dataPoint_pressure :: Maybe Float
 
dataPoint_pressureError :: Maybe Float
 
dataPoint_visibility :: Maybe Float
 
dataPoint_visibilityError :: Maybe Float
 
dataPoint_ozone :: Maybe Float
 
dataPoint_ozoneError :: Maybe Float
 

data DataBlock Source

Defines a summary "block" of information that can contain multiple DataPoints.

data Alerts Source

Defines severe weather alerts that may be being broadcast by a variety of weather services.

data Forecast Source

This is the container type for the returned data. You should be able to just directly take the downloaded JSON and transform it into this data type.