Haskell as a language and GHC as an implementation both lack a mechanism for 'explicitly forbidding the construction of an instance'.

While I can accept an argument that Ratio Int and the like are 'a bad abstraction', they do exist in the language we have today, and the ability to store/load one of these things if you have one strikes me as a thing unrelated to its existence of a bad abstraction.

The badness of the abstraction, however, is not helped nor harmed by the existence of a Storable instance.

If you want to lobby to destroy the polymorphism of Ratio, and limit it to Rational, I'd be all for that. It is a much bigger and much more controversial debate, runs into standards issues, etc., but its one worth considering,.

That said, I don't think crippling the thing we have because you don't think it should exist is the right way to go about it, though.

-Edward


On Mon, Nov 3, 2014 at 3:18 PM, Henning Thielemann <lemming@henning-thielemann.de> wrote:

On Mon, 3 Nov 2014, Edward Kmett wrote:

To be honest I don't think omitting an instance because you don't believe the type should be used at all is a useful strategy.

Explicitly forbidding Storable (Ratio a) has the advantage that we can explain the reasons in the documentation of the blocking instance. In contrast, a missing instance just looks like someone has forgotten it. It would be simple to turn a blocked instance into a useful one in future, once one is found. It is also easier to do so if no orphan instances of Storable (Ratio a) lie around.