On Wed, Mar 24, 2010 at 5:48 AM, Stephen Tetley <stephen.tetley@gmail.com> wrote:

I rather doubt a valuable set of type classes that is suitable for all
containers exists, I'm afraid. 

I don't think it's so clear cut. Stepanov's "Elements of Programming" lays out a pretty clear (and familiar to many Haskellers) path through the algebraic thicket of types, classes, and their properties, albeit in the much clunkier setting of C++ and traits. The disadvantage to this approach is substantial: just as with the from-principles approaches to redoing Haskell's numeric hierarchy, you end up with a fearsome and complex set of typeclasses that are difficult to learn and follow.