[GHC] #9231: 7.8 regression in Read instance of Data.Fixed.Pico

GHC ghc-devs at haskell.org
Tue Jun 24 21:31:09 UTC 2014


#9231: 7.8 regression in Read instance of Data.Fixed.Pico
-------------------------------------+------------------------------------
        Reporter:  leonbaum2         |            Owner:
            Type:  bug               |           Status:  merge
        Priority:  highest           |        Milestone:  7.8.3
       Component:  libraries/base    |          Version:  7.8.2
      Resolution:                    |         Keywords:  regression
Operating System:  Unknown/Multiple  |     Architecture:  Unknown/Multiple
 Type of failure:  None/Unknown      |       Difficulty:  Unknown
       Test Case:                    |       Blocked By:
        Blocking:                    |  Related Tickets:
-------------------------------------+------------------------------------

Comment (by Herbert Valerio Riedel <hvr@…>):

 In [changeset:"ec550e8f951e50fb91c89389e2e77a3358079c3a/ghc"]:
 {{{
 #!CommitTicketReference repository="ghc"
 revision="ec550e8f951e50fb91c89389e2e77a3358079c3a"
 Fixup c1035d51e to behave more like in GHC 7.6

 The fix in c1035d51e (addressing #9231) was done under the assumption
 that `Data.Fixed` is used only with power-of-10 `resolution`. This
 follow-up fixup changes the behavior to be more consistent with the
 previous behavior in GHC 7.6

 For instance, for the following `B7` resolution

    > data B7
    > instance HasResolution B7 where resolution _ = 128

 After this patch, the following behavior is now observable:

    > 1.070 :: Fixed B7
    1.062
    > 1.062 :: Fixed B7
    1.054

    > read "1.070" :: Fixed B7
    1.062
    > read "1.062" :: Fixed B7
    1.054

 This doesn't provide the desirable "read . show == id" property
 yet (which didn't hold in GHC 7.6 either), but at least `fromRational`
 and `read` are consistent.

 Signed-off-by: Herbert Valerio Riedel <hvr at gnu.org>
 }}}

--
Ticket URL: <http://ghc.haskell.org/trac/ghc/ticket/9231#comment:11>
GHC <http://www.haskell.org/ghc/>
The Glasgow Haskell Compiler


More information about the ghc-tickets mailing list