[GHC] #11409: Cannot instantiate literals using TypeApplications

GHC ghc-devs at haskell.org
Fri Jan 15 04:22:04 UTC 2016


#11409: Cannot instantiate literals using TypeApplications
-------------------------------------+-------------------------------------
        Reporter:  Feuerbach         |                Owner:  goldfire
            Type:  bug               |               Status:  new
        Priority:  normal            |            Milestone:
       Component:  Compiler          |              Version:  8.0.1-rc1
      Resolution:                    |             Keywords:
                                     |  TypeApplications
Operating System:  Unknown/Multiple  |         Architecture:
                                     |  Unknown/Multiple
 Type of failure:  None/Unknown      |            Test Case:
      Blocked By:                    |             Blocking:
 Related Tickets:  #11352            |  Differential Rev(s):
       Wiki Page:                    |
-------------------------------------+-------------------------------------

Comment (by goldfire):

 I want to note that the Haskell Report says that `3` desugars to
 `fromInteger THREE`. Perhaps we can indeed hack around this by using
 `integerLit`. But then turning on `RebindableSyntax` would necessitate
 using `fromInteger`, which (due to its membership in the `Num` class),
 must have type `forall a. Num a => Integer -> a`, where the `forall a`
 just comes too early. This would mean that `3 @Int` would work with
 `-XNoRebindableSyntax` but then fail with `-XRebindableSyntax` (when
 importing `Prelude`). It would all be rather unexpected. Worse than the
 status quo? I don't know.

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


More information about the ghc-tickets mailing list