
Hello libraries folk, Following popular demand, I've been working on a class-based collections framework that I would like to submit for review. The main goal is to have something usable right now, making use of generally available haskell extensions for maximum usability/portability ratio (or rather product). http://hackage.haskell.org/trac/ghc/wiki/CollectionClassFramework Cheers, JP.

Hello libraries folk,
Following popular demand, I've been working on a class-based collections framework that I would like to submit for review.
The main goal is to have something usable right now, making use of generally available haskell extensions for maximum usability/portability ratio (or rather product).
http://hackage.haskell.org/trac/ghc/wiki/CollectionClassFramework
My first impression: I like it, keep it up! No time for a second impression yet, though. Cheers, Wolfgang

On 2/14/06, Jean-Philippe Bernardy
Hello libraries folk,
Following popular demand, I've been working on a class-based collections framework that I would like to submit for review.
The main goal is to have something usable right now, making use of generally available haskell extensions for maximum usability/portability ratio (or rather product).
http://hackage.haskell.org/trac/ghc/wiki/CollectionClassFramework
Agree with Wolfgang, first impression is positive. I like the way you separate the i and o parameters. One comment though, with the current setup there's no way to say that the collection is not countable (e.g. a membership function could not be a collection), but I guess that falls under the disclaimer of "practical usage"? :-) Another comment, you note that "We should consider porting this to Associated Types, since it's an alternative for FD in next version of Haskell". Looking at your proposal, there's nothing in there that would not directly port to Associated Types, no problems there. /Niklas

Jean-Philippe Bernardy wrote:
http://hackage.haskell.org/trac/ghc/wiki/CollectionClassFramework
I'm missing the equivalent of pattern matching the head of a list. The closest equivalent would be another method in class Collection: front :: c -> Maybe (o,c) Algorithms that pattern match on a list could be expressed in terms of 'front' instead of 'toList' and a match. In a sense, 'front' is to 'insert' as 'unfoldr' is to 'foldr', so it should be there as well, though possibly under a better name. Udo. -- What nonsense people talk about happy marriages! A man can be happy with any woman so long as he doesn't love her. -- Oscar Wilde
participants (4)
-
Jean-Philippe Bernardy
-
Niklas Broberg
-
Udo Stenzel
-
Wolfgang Thaller