Can we do better than duplicate APIs? [was: Data.CompactString 0.3]

Jean-Philippe Bernardy jeanphilippe.bernardy at
Sat Mar 31 08:18:41 EDT 2007

On 3/26/07, Benjamin Franksen <benjamin.franksen at> wrote:
> Jean-Philippe Bernardy wrote:
> > Please look at
> > for an effort to make most common operation on bulk types fit in a
> > single framework.
> The last time I looked at this (shortly after you started the project) I
> wasn't sure if I would want to use it. Now it seems like an oasis in a
> desert to me. I am pretty much impressed, for instance, you managed to
> unify all the nine existing 'filter' types into a common type class. Cool.
> The only hair in the (otherwise very tasty) soup is "Portability: MPTC, FD,
> undecidable instances" which doesn't sound like it is going to replace the
> Prelude any time soon ;-) Never mind: I definitely consider using this
> instead of importing all these different Data.XYZ modules directly (and,
> heaven forbid, having to import them qualified whenever I need two of them
> in the same module).
> Do you forsee any particular obstacle to an integration (=providing the
> appropriate instances) of e.g. CompactStrings? I would even try to do this
> myself, as an exercise of sorts. How difficult is it in practice to work
> with 'undecidable instances'? Are there special traps one has to be careful
> to walk around?

There are traps. However, if you are already comfortable with MPTC+FD,
I forsee no big trouble.

> > Also, we expect indexed types to solve, or at least alleviate, some
> > problems you mention in your "rant".
> >
> I have been hoping for that to resolve (some of) our troubles, but have been
> confused by the all the back and forth among the experts about whether they
> offer more, or less, or the same, as MPTCs+fundeps+whatever (and that they
> will probably not go into Haskell').
> BTW, any reason I didn't find your collections library in the HackageDB
> (other than stupidity on my part)? (Just interested, I already found the
> darcs repo.)

I just uploaded the latest revision to HackageDB.


More information about the Libraries mailing list