Generic tries (long)
Henning Thielemann
lemming at henning-thielemann.de
Sun Jun 22 16:39:28 EDT 2008
On Sat, 21 Jun 2008, Iavor Diatchki wrote:
> Hi Jamie,
>
> thanks for doing this---I think that the functions in the API look
> good. Of course, one can always think of more :-) One that I often
> find useful when working with Data.Map is a function that removes a
> key from a map and also returns the associated value---a kind of
> destructive lookup.
>
> I think that the library would be better if you exposed a
> non-overloaded API for the map(s?) that you plan to implement. This
> is useful because (i) most of the type I anticipiate using a single
> type of map, and concrete types lead to more accurate types in type
> inference, (ii) it makes the API Haskell'98 and hence likely to work
> on most Haskell implementations out there. If you really think that
> the overloading is useful, then you could provide separate modules
> that provide the class+instances in terms of the non-overloaded API
> and add a cabal flag to turn these on/off.
That's certainly not a good idea, since other modules must be sure, that
if package generic-tries is installed that then the advanced API is
available. Thus the advanced API must be moved to a separate package.
(I prefer that separation.)
More information about the Libraries
mailing list