X-Git-Url: http://gitweb.michael.orlitzky.com/?a=blobdiff_plain;f=src%2FTSN%2FPicklers.hs;h=ea335c81f2894e8de38a44bddea3c5b2938f82c4;hb=027e4df59c88c87889df312d8778f6d466b1c615;hp=bc13badbd7134691fe6ee4158019f3b926cbc41b;hpb=e53fc614221083bc059a6eebfab91172db0a0723;p=dead%2Fhtsn-import.git diff --git a/src/TSN/Picklers.hs b/src/TSN/Picklers.hs index bc13bad..ea335c8 100644 --- a/src/TSN/Picklers.hs +++ b/src/TSN/Picklers.hs @@ -35,8 +35,9 @@ import TSN.Parse ( -- | 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" @@ -46,8 +47,9 @@ 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" @@ -108,9 +110,11 @@ format_commas x = -- | Parse \ from an 'AutoRaceResultsListing'. These are -- essentially 'Int's, but they look like, -- --- * 336,826 --- * 1,000,191 --- * TBA +-- * \336,826\ +-- +-- * \1,000,191\ +-- +-- * \TBA\ -- xp_earnings :: PU (Maybe Int) xp_earnings = @@ -122,7 +126,7 @@ 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" @@ -132,10 +136,11 @@ xp_earnings = -- | (Un)pickle a 'UTCTime' from a \ element in an -- 'AutoRaceResults' message. -- --- Example: +-- Examples: +-- +-- * \6/1/2014 1:00:00 PM\ -- --- 6/1/2014 1:00:00 PM --- 5/24/2014 2:45:00 PM +-- * \5/24/2014 2:45:00 PM\ -- xp_racedate :: PU UTCTime xp_racedate =