| The problem, I think, stems from the need for *efficient implementation*
   | which has unfortunately totally destroyed the abstraction.  

   You're quite right of course.  Actually there's a hierarchy of increasingly
   constrained implementations

           sets with element equality only
           sets with element (total) ordering
           sets with element hashing (ie the ability to map an elt onto
                                      a bounded integer range)

   All this applies to finite maps too, of course (ie you can get away with
   equality only if you are prepared to pay in efficiency).

   GHC's module should probably be called OrdSet or something.  Alistair Reid
   is working on (the specification of) a serious blob of standard libraries
   for Haskell, and I believe he's taking all this into account.

Maybe an even more promising point to start from would be Smalltalks
collection class, which includes variants of the above in addition to
e.g. bags etc.

Marko

-- 
Marko Sch\"utz     [EMAIL PROTECTED]
http://kiste-5.ki.informatik.uni-frankfurt.de/~marko


Reply via email to