type Db Message = Score
instance FromXml Message where
+ -- | When converting from the XML representation to the database
+ -- one, we drop the list of locations which will be foreign-keyed to
+ -- us instead.
from_xml Message{..} =
Score {
db_xml_file_id = xml_xml_file_id,
instance FromXmlFk WeatherForecastXml where
-- | To convert a 'WeatherForecastXml' into a 'WeatherForecast', we
- -- just copy everything verbatim.
+ -- add the foreign key to the containing 'Weather', and copy the
+ -- game date.
--
from_xml_fk fk WeatherForecastXml{..} =
WeatherForecast {