collections in hierarchical libraries

Christian Maeder maeder at tzi.de
Thu Jan 15 12:34:29 EST 2004


Ashley Yakeley wrote:
>>I second Daan's opinion here.  The Haskell community has been searching
>>for good generic collection interfaces for a while and hasn't come up
>>with anything that is obviously the right thing.
> 
> 
> I think that's because the "right thing" involves non-98 extensions 
> (specifically, multiparameter type classes)...

I strongly disagree with this opinion. OPAL has a very good/rich library 
without fancy extensions.

http://uebb.cs.tu-berlin.de/~opal/ocs/doc/html/BibOpalicaManual/BibOpalicaManual.html

It's more a question of writing it all up consistently. The DData stuff 
from Daan is a good start: Consistent namings, possibly using qualified 
imports. Simply add a further structuring level (like "SetLike" and 
"MapLike" form OPAL) for various set and map implementations.

"SetLike" is based on "TreeLike" for sets by binary search trees.

"MapLike" is based "SetLike" in order to return a set as the domain of a 
map. (The Haskell module Data.Set is quite odd as it is based on 
Data.FiniteMap, thus implementing _finite_ sets.)

We also used to have "GraphLike" stuff (based on "MapLike"), but that 
was never elaborated into presentable details. Maybe Erwigs FGL could 
take the place of "GraphLike".

Cheers Christian



More information about the Libraries mailing list