
Hi everybody, 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) * 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? I have been fond of unordered-containers for a while, but found difficulty in creating HashSets of, for example, HashMaps, since there are no Hashable instances for their polymorphic types. I even dug into the code, looking at the possibility of submitting a patch, but gave up when I ran into funky #-suffixed values, which stymied my initial attempt.

Alexander Solla
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.
* 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. The advantage of those is that their speed and memory behavior is more predictable, and they're not subject to hash collision attacks. Serializing them is done by importing your favorite serialization package, be it binary, cereal or safecopy/acid-state. They all have the necessary instances. For all these reasons I'm not a big fan of hash-based data structures, particularly hash tables. Greets, Ertugrul -- Not to be or to be and (not to be or to be and (not to be or to be and (not to be or to be and ... that is the list monad.

On Sun, Jan 20, 2013 at 11:39 AM, Ertugrul Söylemez
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.
participants (2)
-
Alexander Solla
-
Ertugrul Söylemez