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

Copyright(c) 2015 Devan Stormont
Safe HaskellNone



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

These definitions are generally straight conversions from the original JSON. Use of the 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.



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.




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

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.