add Storable a => Storable (Ratio a) and Storable a => Storable (Complex a) to base

Reid Barton rwbarton at gmail.com
Mon Nov 3 17:27:23 UTC 2014


For Storable (Ratio a), when peeking a (Ratio a) value, should the instance
reduce it to lowest terms or not?

If not, then you can construct an unreduced (Ratio a) value, which AFAIK
isn't otherwise possible with the Ratio API.

If so, then you need an (Integral a) constraint as well as (Storable a).
Furthermore, peeking a value and poking it back may change the bytes stored
at the Ptr, which is unusual behavior for a Storable instance.

Neither behavior seems generally useful to all programs, so I'm -1 on
adding any instance for Storable (Ratio a).

+1 for Storable (Complex a) though.

Regards,
Reid Barton

On Mon, Nov 3, 2014 at 11:07 AM, Carter Schonwald <
carter.schonwald at gmail.com> 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!
>
> discussion period 1 week  (because I'd like to get it OK'd with plenty of
> time before the merge window for 7.10 finally closes)
>
> _______________________________________________
> Libraries mailing list
> Libraries at haskell.org
> http://www.haskell.org/mailman/listinfo/libraries
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.haskell.org/pipermail/libraries/attachments/20141103/e7c1ba7c/attachment-0001.html>


More information about the Libraries mailing list