[GHC] #9194: Remove magic parsing of (~)

#9194: Remove magic parsing of (~) ------------------------------------+------------------------------------- Reporter: goldfire | Owner: Type: bug | Status: new Priority: normal | Milestone: Component: Compiler | Version: 7.8.2 Keywords: | Operating System: Unknown/Multiple Architecture: Unknown/Multiple | Type of failure: None/Unknown Difficulty: Unknown | Test Case: Blocked By: | Blocking: Related Tickets: | ------------------------------------+------------------------------------- It seems that `(~)` has magical parsing: {{{ Prelude> :i (~) <interactive>:1:2: parse error on input ‘~’ Prelude> :k (~) (~) :: k -> k -> Constraint Prelude> :i (+) -- for comparison class Num a where (+) :: a -> a -> a ... -- Defined in ‘GHC.Num’ infixl 6 + }}} Now that type operators do not need to start with a colon, this magic seems unnecessary. The `(~)` syntax does not need to be wired-in, unless I'm missing something. (The ''definition'' of `(~)` needs to be wired in -- it's just the syntax that doesn't need to be.) -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/9194 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#9194: Remove magic parsing of (~) -------------------------------------+------------------------------------ Reporter: goldfire | Owner: Type: bug | Status: new Priority: normal | Milestone: Component: Compiler | Version: 7.8.2 Resolution: | Keywords: Operating System: Unknown/Multiple | Architecture: Unknown/Multiple Type of failure: None/Unknown | Difficulty: Unknown Test Case: | Blocked By: Blocking: | Related Tickets: -------------------------------------+------------------------------------ Comment (by goldfire): I suppose this means that it should be exported from `Prelude` and be hidable, available for user definitions, etc. -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/9194#comment:1 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#9194: Remove magic parsing of (~) -------------------------------------+------------------------------------ Reporter: goldfire | Owner: Type: bug | Status: new Priority: normal | Milestone: Component: Compiler | Version: 7.8.2 Resolution: | Keywords: Operating System: Unknown/Multiple | Architecture: Unknown/Multiple Type of failure: None/Unknown | Difficulty: Unknown Test Case: | Blocked By: Blocking: | Related Tickets: -------------------------------------+------------------------------------ Comment (by simonpj): Yes, I suspect that `(~)` pre-dated `-XTypeOperators`. Good idea: I'd be happy if someone did this. Simon -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/9194#comment:2 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#9194: Remove magic parsing of (~) -------------------------------------+------------------------------------ Reporter: goldfire | Owner: Type: bug | Status: new Priority: normal | Milestone: Component: Compiler | Version: 7.8.2 Resolution: | Keywords: Operating System: Unknown/Multiple | Architecture: Unknown/Multiple Type of failure: None/Unknown | Difficulty: Unknown Test Case: | Blocked By: Blocking: | Related Tickets: -------------------------------------+------------------------------------ Comment (by goldfire): Replying to [comment:2 simonpj]:
Yes, I suspect that `(~)` pre-dated `-XTypeOperators`.
And, crucially, allowing type operators to skip the opening colon. Your comment does make me think that this change would then require users to specify `TypeOperators` whenever they use `(~)`. This would be a breaking change that would likely affect a lot of code, and perhaps for little gain. We could just special-case `(~)` not to require `TypeOperators`, but is that any better than the status quo? -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/9194#comment:3 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#9194: Remove magic parsing of (~) -------------------------------------+------------------------------------- Reporter: goldfire | Owner: Type: bug | Status: new Priority: normal | Milestone: Component: Compiler | Version: 7.8.2 (Parser) | Keywords: Resolution: | Architecture: Operating System: Unknown/Multiple | Unknown/Multiple Type of failure: None/Unknown | Test Case: Blocked By: | Blocking: Related Tickets: #10059 | Differential Revisions: -------------------------------------+------------------------------------- Changes (by thomie): * component: Compiler => Compiler (Parser) * related: => #10059 -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/9194#comment:4 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#9194: Remove magic parsing of (~) -------------------------------------+------------------------------------- Reporter: goldfire | Owner: Type: bug | Status: closed Priority: normal | Milestone: Component: Compiler | Version: 7.8.2 (Parser) | Keywords: Resolution: duplicate | Architecture: Operating System: Unknown/Multiple | Unknown/Multiple Type of failure: None/Unknown | Test Case: Blocked By: | Blocking: Related Tickets: #10059, #10056 | Differential Revisions: -------------------------------------+------------------------------------- Changes (by goldfire): * status: new => closed * resolution: => duplicate * related: #10059 => #10059, #10056 Comment: I'm closing this in favor of #10056, which is essentially the same issue and has better comments on the ticket. -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/9194#comment:5 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler
participants (1)
-
GHC