Standard Library report: List union

Jon Fairbairn Jon.Fairbairn@cl.cam.ac.uk
Mon, 04 Mar 2002 20:06:32 +0000


The current library report defines unionBy like this:

  unionBy eq xs ys =3D  xs ++ deleteFirstsBy eq (nubBy eq ys) xs

why does it take the nub of ys, but not xs?  I'd have expected

  unionBy eq xs ys =3D  (nubBy eq xs) ++ deleteFirstsBy eq (nubBy eq ys) =
xs

  J=F3n

-- =

J=F3n Fairbairn                                 Jon.Fairbairn@cl.cam.ac.u=
k
31 Chalmers Road                                         jf@cl.cam.ac.uk
Cambridge CB1 3SZ            +44 1223 570179 (after 14:00 only, please!)