Names for general merge tactics in Data.Map

David Feuer david.feuer at
Sat Aug 20 12:05:04 UTC 2016

You don't have to depend on new GHC versions unless your package uses the
ghc API, which most don't.

On Aug 20, 2016 3:40 AM, "Henning Thielemann" <lemming at>

> On Thu, 18 Aug 2016, David Feuer wrote:
> I realized that it would probably be helpful to put up the actual
>> documentation for the proposed functions. This can be found at
>> map-lazy-merge
> The description of 'generalMerge' mentions diffPreserve, diffDrop,
> diffMapWithKey, but they are not shown in the Haddock page.
> Since there are pretty many functions around 'generalMerge' I would keep
> that stuff in one module and also rename 'generalMerge' to 'merge' because
> the new module provides enough distinction from Data.Map.mergeWithKey.
> Your solution looks pretty elegant to me but for a definitive judgement I
> would like to test it in real applications first. I remember some actual
> and potential uses of 'mergeWithKey' in my code. [1][2][3] It is
> unfortunate that depending on a newer version of containers also forces me
> to depend on new GHC versions. Could you provide the Merge modules in a
> separate package, say containers-merge or containers-compat? Would it be
> possible to implement the Merge modules using the existing mergeWithKey
> function?
> [1]
> 5ffea75e50793a690bd9db4512d540
> [2]
> ef666a69b2d02de36ff9e98c55cd4b
> [3]
> Graph/Comfort/Map.hs#28
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <>

More information about the Libraries mailing list