collection library in Haskell

Alexandru D. Salcianu salcianu at MIT.EDU
Thu Nov 20 17:18:28 EST 2003


Hello!

Can somebody recommend me a good collection library in Haskell?

I'm interested in more than one Set implementation, one FiniteMap
implementation etc. (we already have this in the standard Haskell'98
library).

What I'm searching for is a library where I have the Set, FiniteMap
etc. specifications (i.e., typeclasses), and several implementations
(i.e., instances) for them.  E.g., we can have a list-based
implementation of Set (for small sets), but also a tree-based
implementation (for larger sets).

So, I would like a library with something like this

   -- sa is a type corresponding to sets of a's
   -- requires multi-parameter typeclasses
   class (Eq a) => Set a sa where
     addSetElem :: sa -> a -> sa    -- add an element to a set
     searchElem :: sa -> a -> Bool  -- search an element in a set
     ...


   -- list based Set implementation
   instance (Eq a) => Set a [a] where
     ...

   -- ordered-tree Set implementation
   instance (Ord a) => Set a (OrdTree a) where
     ...

and so on.

Furthermore, I'm interested in a library that can be compiled /
interpreted by a mainstream tool, e.g., ghc, hugs etc.  I've already
started writting such a library (mainly for didactic purposes), but I
would like to know if an enstablished collection library already
exists.

Thanks,

Alex




More information about the Haskell-Cafe mailing list