Heirarchical name space allocation /Trees

Ross Paterson ross at soi.city.ac.uk
Wed Mar 31 14:46:32 EST 2004


On Wed, Mar 31, 2004 at 03:15:32PM +0200, Christian Maeder wrote:
> Adrian Hey wrote:
> >Does the Data.Trees.AVL code exist yet? If not I could donate my
> >implementation. I put quite a bit of effort into producing what
> >I believe should be a fairly fast implemenation.
> 
> The Tree, Seq, Set, Bag and Map stuff should be designed uniformly and 
> therefore be laid into a single hand, i.e. JP Bernardy?, at least initially.
> 
> Rather than enforcing uniformity by a collection class (as proposed 
> elsewhere), I would like uniformity at the module level wrt. exported 
> functions and types. The hierarchy should allow for several different 
> implemenations of one type with (almost) the same module interface.

I'd like to suggest (again) treating sequences differently from the rest,
and that they should be defined by a class:
* the class fits within Haskell 98, because sequences have only one
  parameter, and it's unconstrained.
* polymorphism is likely to be more useful with sequences because of
  the wide range of implementations suited to different purposes.
* polymorphism lets you do general adaptors, like Edison's SizedSeq
  (adding a size) and RevSeq (presenting a reversed view).
Also the sequence part of DData is more tentative, but this is the most
developed part of Edison.  But I'm not suggesting following Edison's
interface (classes + uniform exports).


More information about the Libraries mailing list