From 8fd79929d4e139608ecde40fc70703e0efd56f30 Mon Sep 17 00:00:00 2001 From: Michael Orlitzky Date: Mon, 13 Jan 2014 13:40:30 -0500 Subject: [PATCH] Use (xpOption xpText) instead of xpText0. --- src/TSN/XML/InjuriesDetail.hs | 6 +++--- src/TSN/XML/News.hs | 7 +++---- 2 files changed, 6 insertions(+), 7 deletions(-) diff --git a/src/TSN/XML/InjuriesDetail.hs b/src/TSN/XML/InjuriesDetail.hs index c06768e..3f8be8f 100644 --- a/src/TSN/XML/InjuriesDetail.hs +++ b/src/TSN/XML/InjuriesDetail.hs @@ -39,9 +39,9 @@ import Text.XML.HXT.Core ( xpElem, xpInt, xpList, + xpOption, xpPrim, xpText, - xpText0, xpWrap ) import TSN.Picklers( xp_date, xp_team_id ) @@ -60,7 +60,7 @@ data PlayerListing = name :: String, injury :: String, status :: String, - fantasy :: String, -- ^ Nobody knows what this is. + fantasy :: Maybe String, -- ^ Nobody knows what this is. injured :: Bool, injury_type :: String -- ^ "type" is a reserved keyword so we can't use it } @@ -121,7 +121,7 @@ pickle_player_listing = (xpElem "Name" xpText) (xpElem "Injury" xpText) (xpElem "Status" xpText) - (xpElem "Fantasy" xpText0) + (xpElem "Fantasy" $ xpOption xpText) (xpElem "Injured" xpPrim) (xpElem "Type" xpText) where diff --git a/src/TSN/XML/News.hs b/src/TSN/XML/News.hs index 49ff8b7..a388415 100644 --- a/src/TSN/XML/News.hs +++ b/src/TSN/XML/News.hs @@ -39,7 +39,6 @@ import Text.XML.HXT.Core ( xpOption, xpPair, xpText, - xpText0, xpTriple, xpWrap ) @@ -114,7 +113,7 @@ data Message = xml_mid :: MsgId, xml_category :: String, xml_sport :: String, - xml_url :: String, + xml_url :: Maybe String, xml_teams :: [NewsTeam], xml_locations :: [NewsLocation], xml_sms :: String, @@ -128,7 +127,7 @@ data News = News { db_mid :: MsgId, db_sport :: String, - db_url :: String, + db_url :: Maybe String, db_sms :: String, db_editor :: Maybe String, db_text :: Maybe String, @@ -271,7 +270,7 @@ pickle_message = pickle_msg_id (xpElem "category" xpText) (xpElem "sport" xpText) - (xpElem "url" xpText0) + (xpElem "url" $ xpOption xpText) (xpList pickle_news_team) (xpList pickle_location) (xpElem "SMS" xpText) -- 2.43.2