[Haskell-cafe] A typeclass for Data.Map etc?

Alexander Dunlap alexander.dunlap at gmail.com
Thu Feb 19 21:17:11 EST 2009


On Thu, Feb 19, 2009 at 10:18 AM, Jamie Brandon <jamiiecb at googlemail.com> wrote:
>> Maybe this is of interest:
>> http://hackage.haskell.org/cgi-bin/hackage-scripts/package/gmap
>
> The edison api is much more stable. The gmap api was already in place
> when I started working on it but I would prefer to at some point make
> it a superset of the edison api. No sense in having more than one map
> interface lying around.
>
> Jamie

What would really be nice is a general interface to a lot of different
types of containers that was both standardized by the community AND
used as the basis for lots of different libraries. For instance, the
new split package is a well-crafted library for dealing with splitting
lists, but it only works on lists. The exact same logic that's already
there could be used for splitting ByteStrings, Lazy ByteStrings,
Data.Sequences, some of the sequence types in Edison, fixed-length
vectors, etc., but currently, the way the package is made forces you
to use only Haskell's lazy lists. Now if we look at the zlib package,
this package decompresses data into the lazy ByteString format. So you
can't directly split data that comes out of zlib - you have to convert
it to String and then back again, which is annoying and also imposes a
performance cost. If we could figure out a way to have a general
interface to "sequence-like" or "map-like" or "set-like" objects, we
could make our libraries a lot more general and also more useful in
combination with each other.

Alex


More information about the Haskell-Cafe mailing list