]> gitweb.michael.orlitzky.com - dead/htsn-import.git/blobdiff - src/TSN/XML/Odds.hs
Make team names and abbreviations optional.
[dead/htsn-import.git] / src / TSN / XML / Odds.hs
index 7af360cfb53f6adb3fa421ef18f07e0214fc5134..b76be762dee067d4b2125ad28668b21bfc3ab7eb 100644 (file)
@@ -183,8 +183,8 @@ instance FromXml OddsGameHomeTeamXml where
   from_xml OddsGameHomeTeamXml{..} =
     Team {
       team_id   = xml_home_team_id,
-      team_abbreviation      = xml_home_abbr,
-      team_name = xml_home_team_name }
+      team_abbreviation = Just xml_home_abbr,
+      team_name = Just xml_home_team_name }
 
 -- | This allows us to insert the XML representation
 --   'OddsGameHomeTeamXml' directly.
@@ -224,8 +224,8 @@ instance FromXml OddsGameAwayTeamXml where
   --
   from_xml OddsGameAwayTeamXml{..} = Team
                                        xml_away_team_id
-                                       xml_away_abbr
-                                       xml_away_team_name
+                                       (Just xml_away_abbr)
+                                       (Just xml_away_team_name)
 
 -- | This allows us to insert the XML representation
 --   'OddsGameAwayTeamXml' directly.
@@ -729,7 +729,7 @@ odds_tests =
 test_pickle_of_unpickle_is_identity :: TestTree
 test_pickle_of_unpickle_is_identity = testGroup "pickle-unpickle tests"
   [ check "pickle composed with unpickle is the identity"
-         "test/xml/Odds_XML.xml",
+          "test/xml/Odds_XML.xml",
 
     check "pickle composed with unpickle is the identity (non-int team_id)"
           "test/xml/Odds_XML-noninteger-team-id.xml",