
Curiously, it seems classes aren't used much in the libraries. I.e. I wanted my data structure to be used more or less like an array (it was basically an array with some extras), but I couldn't just
instance Indexed Foo where a ! i = ... bounds a = ...
Hmm, very true. Perhaps there ought to be a way to define new instances of IArray and HasBounds - unfortunately IArray doesn't have the obvious methods like (!) and 'array' any more, it has methods like 'unsafeArray' and 'unsafeAt' which are versions of these without bounds checking (for efficiency - bounds checks are done only when necessary).
I can of course always define operations using different names, but IMHO reusing common ones, like (!) makes the code much more readable.
Similar for Sets, lists, and FMs, I'd expect something like
instance Collection a where empty = ... (!!) cardinality -- or whatever
and so on.
There have been lots of proposals for collection classes over the years, and no single one stands out as an obvious choice. However, I don't think we should stop looking - this is arguably one of the most important pieces still missing from the libraries, and the longer we go on without a good framework for collections, the harder it will be to add one. So get designing! Cheers, Simon