[GHC] #14170: 8.2.1 regression: GHC fails to simplify `natVal`

GHC ghc-devs at haskell.org
Tue Sep 26 17:55:34 UTC 2017


#14170: 8.2.1 regression: GHC fails to simplify `natVal`
-------------------------------------+-------------------------------------
        Reporter:  vagarenko         |                Owner:  (none)
            Type:  bug               |               Status:  new
        Priority:  high              |            Milestone:  8.2.2
       Component:  Compiler          |              Version:  8.2.1
      Resolution:                    |             Keywords:
Operating System:  Unknown/Multiple  |         Architecture:
                                     |  Unknown/Multiple
 Type of failure:  None/Unknown      |            Test Case:
      Blocked By:                    |             Blocking:
 Related Tickets:                    |  Differential Rev(s):
       Wiki Page:                    |
-------------------------------------+-------------------------------------

Comment (by bgamari):

 I'm not really sure representing `Integer` and `Natural` is a great idea.
 Afterall, we then need to painstakingly evaluate all of the constant
 folding rules to ensure we don't, for instance, rewrite `(5 - 9) ::
 Natural` to `-4`. Moreover, distinguishing `Integer` `LitIntegers` from
 `Natural` `LitIntegers` on the basis of type alone would mean that
 `CorePrep` will need to do a type comparison in `cpeRhsE` instead of just
 deciding on the basis of which `Literal` constructor was used. In sum, I
 suspect `Integer` and `Natural` are just different enough to warrant
 separate constructors.

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


More information about the ghc-tickets mailing list