X-Git-Url: http://gitweb.michael.orlitzky.com/?p=dead%2Fhtsn-import.git;a=blobdiff_plain;f=src%2FTSN%2FXML%2FInjuriesDetail.hs;h=3f1ba167e8d8a2d2c29bc7656063a04f032527e0;hp=4dda8442eca62840a55cc3ed14e51265f6eb48e2;hb=f6708a3fa86d84914e5c67e339f192460864c143;hpb=db7b2a81b5b8fa0357f3340761804e2a56a6db30 diff --git a/src/TSN/XML/InjuriesDetail.hs b/src/TSN/XML/InjuriesDetail.hs index 4dda844..3f1ba16 100644 --- a/src/TSN/XML/InjuriesDetail.hs +++ b/src/TSN/XML/InjuriesDetail.hs @@ -27,8 +27,12 @@ where import Control.Monad ( forM_ ) import Data.Time ( UTCTime ) import Data.Tuple.Curry ( uncurryN ) -import qualified Data.Vector.HFixed as H ( HVector, cons, convert, tail ) -import qualified Data.Vector.HFixed.Cont as H (ContVec) +import qualified Data.Vector.HFixed as H ( + HVector, + asCVec, + cons, + convert, + tail ) import Database.Groundhog ( DefaultKey, countAll, @@ -276,13 +280,13 @@ instance Child InjuriesDetailListingPlayerListingXml where instance FromXmlFk InjuriesDetailListingPlayerListingXml where -- | To construct a 'InjuriesDetailListingPlayerListing' from a -- 'InjuriesDetailListingPlayerListingXml' we need to supply a - -- foreign key to an 'InjuriesDetailListing'. + -- foreign key to an 'InjuriesDetailListing' after dropping the + -- '_xml_player_team_id'. -- - from_xml_fk fk = (H.cons fk) . asCont . H.tail - where - -- Should be in the library soon. - asCont :: H.ContVec a -> H.ContVec a - asCont = id + -- The 'H.asCVec' trick allows type inference to proceed in the + -- middle of two different magics. + -- + from_xml_fk fk = (H.cons fk) . H.asCVec . H.tail -- | This lets us insert the XML representation