
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 would implement it myself, but as I said, I am just learning FP. Thanks, James

--- haskell@alias.spaceandtime.org 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 :) JP. __________________________________ Do you Yahoo!? Yahoo! Photos: High-quality 4x6 digital prints for 25� http://photos.yahoo.com/ph/print_splash

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)
This is exactly what I'm currently doing. But it would be nice to have in the libraries. MultiSet is easily emulated as well, but it's there.
With the scheme I described eariler, it is rather trivial to implement; (almost) all you need is to rename functions.
Are you suggesting I implement it for the libraries, or for myself? If it's the former, trust me, you don't want *me* doing that. :) If it's the latter, I have, in some part, but it's a pain and distracts me from my primary goal. Thanks, James
participants (2)
-
haskell@alias.spaceandtime.org
-
JP Bernardy