[GHC] #10056: Inconsistent precedence of ~

GHC ghc-devs at haskell.org
Tue Aug 4 15:30:26 UTC 2015


#10056: Inconsistent precedence of ~
-------------------------------------+-------------------------------------
        Reporter:  crockeea          |                   Owner:
            Type:  bug               |                  Status:  new
        Priority:  normal            |               Milestone:
       Component:  Compiler          |                 Version:  7.8.4
  (Parser)                           |
      Resolution:                    |                Keywords:
Operating System:  Unknown/Multiple  |            Architecture:
 Type of failure:  GHC rejects       |  Unknown/Multiple
  valid program                      |               Test Case:
      Blocked By:                    |                Blocking:
 Related Tickets:  #10059            |  Differential Revisions:
-------------------------------------+-------------------------------------

Comment (by RyanGlScott):

 How exactly would this work? In order to make `(~)` have lower precedence
 than `(->)`, it seems to me we'd have to do one of the following [1]:

 1. Give `(~)` a negative precedence.
 2. Declare `infix 0 ~` and give `(->)` a higher precedence.

 Option 1 sounds particularly scary, since we'd be changing the lower bound
 of precedences. Option 2 allows users to define their own type operators
 that have lower precedence than `(->)`, and may cause some existing code
 to break.

 [1] That is, assuming that we're still committed to the idea of non-
 magically parsing `(~)` like any other type operator.

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


More information about the ghc-tickets mailing list