[GHC] #10056: Inconsistent precedence of ~

GHC ghc-devs at haskell.org
Tue Aug 4 16:27:08 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):

 OK, so the idea is to still require that user-defined fixity declarations
 have precedence 0–9, but grant exceptions for certain types (e.g., `(~)`).
 I think this would technically meet the Haskell 2010 Report, so that's
 good.

 As far as implementation details go, it looks like `(->)`'s fixity is
 currently hardwired in
 [http://git.haskell.org/ghc.git/blob/f063bd5413edf40f1b48e0f958410dcb6bf20b68:/compiler/basicTypes/BasicTypes.hs#l344
 BasicTypes.hs], so we could stick in {{{tildeFixity = Fixity (-1) Infix}}}
 there. I'm not aware of any bounds-checking code that would be tripped up
 by having a precedence lower than {{{minPrecedence = 0}}}, so I don't
 think that would be too invasive of a change.

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


More information about the ghc-tickets mailing list