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

On Mon, 3 Nov 2014, Carter Schonwald wrote:

Getting those two into base for 7.10 would be quite nice. 
I think this will mostly impact folks who maintain numerical computing libraries, such as myself, and even
then, I think this would be a change well worth having!

Storable (Complex a) would be nice, but how can Storable (Ratio a) work reliably? (Storable a) means that values of type 'a' are represented by a fixed number of bytes. That is, for (Storable a => Ratio a) you would have a ratio of fixed size integers. Silent overflow in integers is already nasty, but in Ratios the effect of overflows is even worse.

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?

Michael