[GHC] #13186: Change EvNum to EvNum :: Natural -> EvLit

GHC ghc-devs at haskell.org
Thu Jan 26 12:06:23 UTC 2017


#13186: Change EvNum to EvNum :: Natural -> EvLit
-------------------------------------+-------------------------------------
        Reporter:  phadej            |                Owner:
            Type:  feature request   |               Status:  new
        Priority:  normal            |            Milestone:
       Component:  Compiler          |              Version:  8.0.1
      Resolution:                    |             Keywords:
Operating System:  Unknown/Multiple  |         Architecture:
                                     |  Unknown/Multiple
 Type of failure:  None/Unknown      |            Test Case:
      Blocked By:                    |             Blocking:
 Related Tickets:  #8306 #8412       |  Differential Rev(s):
  #13181                             |
       Wiki Page:                    |
-------------------------------------+-------------------------------------

Comment (by phadej):

 On the other hand:

 > This smells funny. Why is there so much Integer here? Why is a
 conversion from Integer to Natural being put in such deep code? I'm
 clearly missing something!

 https://phabricator.haskell.org/D3024

 AFAICS, it's totally possible to thread Natural thru the pipeline, we do
 very little calculations with type level nats (in a single module),
 everywhere else the value is just passed forward. Like in
 https://github.com/ghc/ghc/blob/ff9355e48d0cb04b3adf26e27e12e128f79618f4/compiler/typecheck/TcInteract.hs#L2106

 And then we could use `minusNaturalMaybe`
 https://github.com/ghc/ghc/blob/ff9355e48d0cb04b3adf26e27e12e128f79618f4/compiler/typecheck/TcTypeNats.hs#L691
 here, i.e. unify `Natural` and `KnownNat` handling by ''using same
 functions''.

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


More information about the ghc-tickets mailing list