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


On Mon, 3 Nov 2014, Michael Snoyman wrote:

I may be missing something, but wouldn't the `Storable` constraint ensure that only integral types with a
fixed size can be stored? Said another way, `Ratio a` is isomorphic to a strict pair of `a`, and the latter
can clearly be serialized without any loss of precision. Why would `Ratio a` be any different?

You can serialize it without problems, but the arithmetic of Ratios with fixed size integers is pretty, say, non-standard. :-)

E.g.

Prelude Data.Ratio> 1%29 + 1%31 :: Rational
60 % 899

Prelude Data.Ratio> 1%29 + 1%31 :: Int8
12 % (-25)

In other words, you don't disagree with the `Storable` instance itself being valid, it's just that it encourages bad practice?

Michael