]> gitweb.michael.orlitzky.com - dead/htsn-import.git/blobdiff - src/TSN/XML/Weather.hs
Fix some docs in Odds and Weather.
[dead/htsn-import.git] / src / TSN / XML / Weather.hs
index 3279ec81119cf16c231a9c178b1920918b881f86..ae79a44bd7d5c08944837b182f98af620e2fd10c 100644 (file)
@@ -5,7 +5,7 @@
 {-# LANGUAGE TemplateHaskell #-}
 {-# LANGUAGE TypeFamilies #-}
 
--- | Parse TSN XML for the DTD "weatherxml.dtd". Each document
+-- | Parse TSN XML for the DTD \"weatherxml.dtd\". Each document
 --   contains a bunch of forecasts, which each contain one league, and
 --   that league contains a bunch of listings.
 --
@@ -60,6 +60,8 @@ import Xml (
 -- DB/XML Data types
 --
 
+-- * WeatherForecastListing/WeatherForecastListingXml
+
 -- | XML representation of a weather forecast listing.
 --
 data WeatherForecastListingXml =
@@ -83,10 +85,13 @@ data WeatherForecastListing =
 instance ToDb WeatherForecastListingXml where
   type Db WeatherForecastListingXml = WeatherForecastListing
 
--- | This is needed to define the XmlImport instance for
--- 'WeatherForecastListing'.
+-- | This is needed to define the 'XmlImportFk' instance for
+--   'WeatherForecastListing'.
 --
 instance FromXmlFk WeatherForecastListingXml where
+  -- | Each 'WeatherForecastListingXml' is contained in a
+  --   'WeatherForecast'.
+  --
   type Parent WeatherForecastListingXml = WeatherForecast
 
   from_xml_fk fk WeatherForecastListingXml{..} =
@@ -95,12 +100,14 @@ instance FromXmlFk WeatherForecastListingXml where
       db_teams = xml_teams,
       db_weather = xml_weather }
 
--- | Allows us to call 'insert_xml' on the XML representation of
---   WeatherForecastListing.
+-- | This allows us to insert the XML representation
+--   'WeatherForecastListingXml' directly.
 --
 instance XmlImportFk WeatherForecastListingXml
 
 
+-- * WeatherLeague
+
 -- | XML representation of a league, as they appear in the weather
 --   documents. There is no associated database representation because
 --   the league element really adds no information besides its own
@@ -114,6 +121,9 @@ data WeatherLeague =
     listings :: [WeatherForecastListingXml] }
   deriving (Eq, Show)
 
+
+-- * WeatherForecast/WeatherForecastXml
+
 -- | Database representation of a weather forecast.
 --
 data WeatherForecast =
@@ -157,6 +167,8 @@ instance FromXmlFk WeatherForecastXml where
 instance XmlImportFk WeatherForecastXml
 
 
+-- * Weather/Message
+
 -- | The database representation of a weather message.
 --
 data Weather =
@@ -196,12 +208,16 @@ instance FromXml Message where
       db_title = xml_title,
       db_time_stamp = xml_time_stamp }
 
--- | This allows us to call 'insert_xml' on a 'Message' without first
---   converting it to the database representation.
+-- | This allows us to insert the XML representation 'Message'
+--   directly.
 --
 instance XmlImport Message
 
 
+--
+-- Database stuff
+--
+
 mkPersist tsn_codegen_config [groundhog|
 - entity: Weather
   constructors:
@@ -255,6 +271,9 @@ instance DbImport Message where
     return ImportSucceeded
 
 
+---
+--- Pickling
+---
 
 -- | Pickler to convert a 'WeatherForecastListingXml' to/from XML.
 --