Proposal: add conversion functions to Data.Fixed.
ekmett at gmail.com
Sun Dec 9 03:54:13 CET 2012
I would be a +1 to any or all of these changes. I, too, don't see the point
in hiding the constructor in a separate module. Like you said, the
fromEnum/toEnum instances already give away the farm.
On Sat, Dec 8, 2012 at 12:49 AM, Ashley Yakeley <ashley at semantic.org> wrote:
> already expose the internal Integer, badly, as an Int.
> These are the changes I think we should make to Fixed:
> 1. Make the internal type generic, similar to Ratio/Rational.
> 2. Make access to the internal type easy and fast. Ratio has
> numerator/denominator/(%), but Ratio needs to canonicalise its values to
> lowest terms. Fixed doesn't need that, so exposing the constructor should
> 3. Move Data.Fixed into a new package, possibly with Data.Ratio and
> perhaps other numerics stuff that can be moved out of base.
> 4. Move div', mod' and divmod' to a more sensible module and maybe rename
> them, or have them replace div, mod and divmod.
> I am somewhat motivated to 1 by calls to make certain time types generic,
> although that's a separate discussion with its own issues.
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the Libraries