These are all very good questions! Here's my stab at it:
What is the right interface for a queue? What is the right interface for a random number generator?
I don't know, but in both cases you will find many packages on hackage offering different takes on the matter. In fact, there is a wilderness of alternative interfaces. We've had various discussions on this list about the number of alternative packages.
I'm fine with lots of packages, but I think it would be great if not every package introduced a new interface as well as a new implementation. If we could agree as a community on common interfaces to use for some basics, that would probably go a long way towards taming the type class wilderness. People have mentioned this problem before with respect to "Collections" generally.
One basic part of reaching such a goal is separating interface from implementation. I ran into the following problems just in the last 24 hours. In both cases I wanted to use a type class, but didn't want to depend on the whole package it lived in:
- I wanted to use the Benchmarkable class in Criterion in my package. (Criterion deserving to be a "standard" package.) But I can't get that typeclass without depending on the whole Criterion package, which has several dependencies. And in fact on the machine I was on at the time some of those dependencies were broken, so I decided not to use Benchmarkable.
- I wanted to use, or at least support, an existing class for Queues. I found the following:
How can we enumerate packages that at least purport to provide standard interfaces that you should both use and pick up to implement? On a Wiki page?