- -- want to get back a Left (id) for the existing team when
- -- there's a collision. In fact, if the insert succeeds, we'll
- -- get a Right (id) back, so we can disregard the Either
- -- constructor entirely. That's what the (either id id) does.
- either_nt_ids <- mapM insertByAll_xml (xml_teams message)
- let nt_ids = map (either id id) either_nt_ids
+ -- want to get back the id for the existing team when
+ -- there's a collision.
+ nt_ids <- mapM insert_xml_or_select (xml_teams message)