[Haskell-cafe] Container libraries

Alexander Solla alex.solla at gmail.com
Sun Jan 20 21:06:04 CET 2013


On Sun, Jan 20, 2013 at 11:39 AM, Ertugrul Söylemez <es at ertes.de> wrote:

> > What is the state of container libraries?  I am looking for a library
> > which provides:
> >
> > * unordered containers (for "operational" type safety, I don't want to
> > impose orders on things that don't have them -- unordered containers
> > does this)
>
> You are imposing an order.
>

I mean I don't want Ord instances for types with no "natural" order.  I
don't mind that a container structure will impose the topological order, or
that containers can be ordered by inclusion.

In particular, I have datatypes whose values represent incomparable "atoms"
of some type.  A comparison between them should "really" yield bottom.  So
an Ord-based container is not appropriate.  I'd rather not have an Ord
instance for these types and therefore statically eliminate that bottom.


>
>
> > * can handled nested containers (containers does that)
> > * can be serialized easily, or better yet, has Generic instances
> >
> > Does such a library exist?  What are you using for Set and Map needs?
>
> What's wrong with 'containers' itself?  I prefer Map/Set over
> HashMap/HashSet, because the speed difference is small and only
> noticable for large maps/sets.  If you need multiple indices, there is
> IxSet.


I took a look at 'hashmap', which uses 'hashable' and 'containers' to
implement hash containers.  I worried about the performance, and thought
I'd ask for opinions on containers.

My goal is to create an IxSet-like structure which can handle unordered
types, and preferably whose indices can be derived GHC.Generics-ally.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.haskell.org/pipermail/haskell-cafe/attachments/20130120/f6be92ea/attachment.htm>


More information about the Haskell-Cafe mailing list