Proposal: Tidy up and export PSQ from base
Edward Z. Yang
ezyang at MIT.EDU
Sat Apr 30 20:44:34 CEST 2011
I understand the sentiment. As I mentioned earlier, the reason why I'm
interested in getting some amount of code reuse is that Hoopl (which is
also in the bootstrap libraries) needs priority queue implementation.
If it really is that specialized, it might be a better idea to just put another
copy of it in Hoopl (though I'd not be too happy about that!)
Edward
Excerpts from Bryan O'Sullivan's message of Sat Apr 30 13:48:05 -0400 2011:
> On Sat, Apr 30, 2011 at 9:24 AM, Isaac Dupree <
> ml at isaac.cedarswampstudios.org> wrote:
>
> >
> > (After code cleanup), you *could* re-export base:GHC.Event.PSQ as
> > containers:Data.PSQ ... then if base ever stops needing it, you can copy the
> > implementation into containers (where I guess it logically belongs) without
> > breaking everything?
>
>
> I don't think it makes much sense to do anything with the PSQ code in
> GHC.Event. When we were writing the event manager, we tore out every piece
> of non-essential PSQ code in order to keep the mental footprint of base as
> small as we reasonably could. You'll find a trimmed-down and specialised
> copy of IntMap in the event manager subtree, too.
>
> Tying general-purpose data structures to base in any way would be a mistake,
> I think, as it would constrain them to a slow and laborious maintenance and
> improvement cycle. If you want evidence, witness the fitful progress of all
> the good work on the containers package over the past 18 months. Indeed, to
> avoid the containers morass, I'd recommend putting that PSQ implementation
> in a package of its own and just leaving it at that (assuming there's not
> already a copy on Hackage).
More information about the Libraries
mailing list