request: MultiMap

JP Bernardy jyp_7 at
Mon Apr 26 09:50:13 EDT 2004

--- haskell at wrote:
> Hello,
> I would like to request that multimap be added to
> the data library.  As a
> C++ programmer (and a complete Haskell newbie), I
> find myself frequently
> using std::multimap from the STL.  However, as I'm
> moving my programs to
> Haskell, I'm having to do hacks such as a maps of
> keys to sets of values.
>  I noticed that DData is under consideration, which
> has a multiset, so
> why not a multimap?

I suggest you try "Map key (Set value)" with DData.
A number of functions are there to help you to
implement multimap semantics. (i.e. unionWith, adjust)

> I would implement it myself,
> but as I said, I am
> just learning FP.

With the scheme I described eariler, it is rather
trivial to implement; (almost) all you need is to
rename functions.

> Thanks,

You're welcome :)

Do you Yahoo!?
Yahoo! Photos: High-quality 4x6 digital prints for 25¢

More information about the Libraries mailing list