[Haskell-cafe] Can we do better than duplicate APIs? [was: Data.CompactString 0.3]

Simon Peyton-Jones simonpj at microsoft.com
Mon Mar 26 03:53:05 EDT 2007

| One reason why I think type classes have not (yet) been used to reduce the
| amount of API repetition is that Haskell doesn't (directly) support
| abstraction over type constraints nor over the number of type parameters
| (polykinded types?). Often such 'almost equal' module APIs differ in
| exactly these aspects, i.e. one has an additional type parameter, while yet
| another one needs slightly different or additional constraints on certain
| types.

Interesting observation. Can you give a few examples in support of it?

| Or maybe we have come to the point where Haskell's lack of a 'real' module
| system, like e.g. in SML, actually starts to hurt?

Great though ML modules are, it's not clear to me how they help in this case.  Can you illustrate how the repetition could be avoided if you had ML modules?


More information about the Libraries mailing list