-- | The format string for a base date in m/d/yyyy format. The
-- day/month are not padded at all. This will match for example,
--
--- * 2/15/1983
--- * 1/1/0000
+-- * 2\/15\/1983
+--
+-- * 1\/1\/0000
--
date_format :: String
date_format = "%-m/%-d/%Y"
-- day/month are padded to two characters with zeros. This will
-- match for example,
--
--- * 02/15/1983
--- * 01/01/0000
+-- * 02\/15\/1983
+--
+-- * 01\/01\/0000
--
date_format_padded :: String
date_format_padded = "%0m/%0d/%Y"
-- | Parse \<Earnings\> from an 'AutoRaceResultsListing'. These are
-- essentially 'Int's, but they look like,
--
--- * <Earnings>336,826</Earnings>
--- * <Earnings>1,000,191</Earnings>
--- * <Earnings>TBA</Earnings>
+-- * \<Earnings\>336,826\</Earnings\>
+--
+-- * \<Earnings\>1,000,191\</Earnings\>
+--
+-- * \<Earnings\>TBA\</Earnings\>
--
xp_earnings :: PU (Maybe Int)
xp_earnings =
to_earnings :: String -> Maybe Int
to_earnings s
| s == "TBA" = Nothing
- | otherwise = (read . strip_commas . show) s
+ | otherwise = Just $ (read . strip_commas) s
from_earnings :: Maybe Int -> String
from_earnings Nothing = "TBA"
-- | (Un)pickle a 'UTCTime' from a \<RaceDate\> element in an
-- 'AutoRaceResults' message.
--
--- Example:
+-- Examples:
+--
+-- * \<RaceDate\>6/1/2014 1:00:00 PM\</RaceDate\>
--
--- <RaceDate>6/1/2014 1:00:00 PM</RaceDate>
--- <RaceDate>5/24/2014 2:45:00 PM</RaceDate>
+-- * \<RaceDate\>5/24/2014 2:45:00 PM\</RaceDate\>
--
xp_racedate :: PU UTCTime
xp_racedate =