]> gitweb.michael.orlitzky.com - dead/htsn-import.git/blobdiff - src/TSN/XML/AutoRacingResults.hs
Add some docs for AutoRacingResults, and fix others.
[dead/htsn-import.git] / src / TSN / XML / AutoRacingResults.hs
index 596b0bd46c4d7fff742a444f304ef3a7ec462360..96433ee0e7638efd31c257e61e812b12776c4970 100644 (file)
@@ -82,7 +82,9 @@ dtd = "AutoRacingResultsXML.dtd"
 
 -- * AutoRacingResults/Message
 
--- | Database representation of a 'Message'.
+-- | Database representation of a 'Message'. Comparatively, it lacks
+--   the listings and race information since they are linked via a
+--   foreign key.
 --
 data AutoRacingResults =
   AutoRacingResults {
@@ -101,7 +103,9 @@ data AutoRacingResults =
 
 
 
--- | XML Representation of an 'AutoRacingResults'.
+-- | XML Representation of an 'AutoRacingResults'. It has the same
+--   fields, but in addition contains the 'xml_listings' and
+--   'xml_race_information'.
 --
 data Message =
   Message {
@@ -177,6 +181,7 @@ data AutoRacingResultsListing =
     db_nc :: Maybe Bool,
     db_earnings :: Maybe Int }
 
+
 -- | XML representation of a \<Listing\> contained within a
 --   \<message\>.
 --
@@ -204,6 +209,7 @@ instance ToDb AutoRacingResultsListingXml where
   --
   type Db AutoRacingResultsListingXml = AutoRacingResultsListing
 
+
 instance FromXmlFk AutoRacingResultsListingXml where
   -- | Each 'AutoRacingResultsListingXml' is contained in (i.e. has a
   --   foreign key to) a 'AutoRacingResults'.
@@ -396,8 +402,10 @@ mkPersist tsn_codegen_config [groundhog|
             onDelete: cascade
         - name: db_most_laps_leading
           embeddedType:
-            - {name: most_laps_leading_driver_id, dbName: most_laps_leading_driver_id}
-            - {name: most_laps_leading_driver, dbName: most_laps_leading_driver}
+            - {name: most_laps_leading_driver_id,
+               dbName: most_laps_leading_driver_id}
+            - {name: most_laps_leading_driver,
+               dbName: most_laps_leading_driver}
 
 - embedded: MostLapsLeading
   fields:
@@ -414,6 +422,8 @@ mkPersist tsn_codegen_config [groundhog|
 --- Pickling
 ---
 
+-- | Pickler for the \<Listing\>s contained within \<message\>s.
+--
 pickle_listing :: PU AutoRacingResultsListingXml
 pickle_listing =
   xpElem "Listing" $
@@ -449,6 +459,7 @@ pickle_listing =
 
 
 -- | Pickler for the top-level 'Message'.
+--
 pickle_message :: PU Message
 pickle_message =
   xpElem "message" $
@@ -483,6 +494,9 @@ pickle_message =
                   xml_time_stamp m)
 
 
+-- | Pickler for the \<Most_Laps_Leading\> child of a
+--   \<Race_Information\>.
+--
 pickle_most_laps_leading :: PU MostLapsLeading
 pickle_most_laps_leading =
   xpElem "Most_Laps_Leading" $
@@ -496,6 +510,9 @@ pickle_most_laps_leading =
                   db_most_laps_leading_driver m,
                   db_most_laps_leading_number_of_laps m)
 
+
+-- | Pickler for the \<Race_Information\> child of \<message\>.
+--
 pickle_race_information :: PU AutoRacingResultsRaceInformationXml
 pickle_race_information =
   xpElem "Race_Information" $