Hi Merijn,
I have seen unionWith (<>) used many times and it is indeed a useful operation.
I also do not recall ever relying on the Monoid instance that's defined currently.
However, I never needed a newtype wrapper.
Moreover, introducing a newtype just for the sake of the right Monoid instance does not seem to be worth it.
For one I'd want to have all the other useful Map/Set functions (e.g. lookup) defined on the newtype to not have to deal with wrapping/unwrapping newtype. So for the newtype to really be useful, I guess you would have to copy all the functions. I'm guessing this will introduce some maintenance burden.
Besides you can't really add one newtype for all strict/lazy Map/IntMap. Since `unionWith` is not a typeclass member, you'd have to resort to 4 (or more) newtypes, one for each Map type. And you'd have to copy over all the functions for each newtype...
I'd be really happy to see default Monoid instances changed, but I too think that's not going to happen (at least anytime soon).
In the meantime unionWith (<>) seems reasonable enough.
Can you elaborate on how you benefited from a newtype?
Why unionWith (<>) was not enough?
Kind regards,
Nick