[GHC] #10059: :i doesn't work for ~

#10059: :i doesn't work for ~ -------------------------------------+------------------------------------- Reporter: dfeuer | Owner: Type: bug | Status: new Priority: normal | Milestone: Component: GHCi | Version: 7.11 Keywords: | Operating System: Unknown/Multiple Architecture: | Type of failure: Other Unknown/Multiple | Blocked By: Test Case: | Related Tickets: Blocking: | Differential Revisions: | -------------------------------------+------------------------------------- {{{#!hs Prelude> :set -XTypeOperators Prelude> :i (~) <interactive>:1:2: parse error on input ‘~’ Prelude> :k (~) (~) :: k -> k -> Constraint }}} -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/10059 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#10059: :i doesn't work for ~ -------------------------------------+------------------------------------- Reporter: dfeuer | Owner: Type: bug | Status: new Priority: normal | Milestone: Component: GHCi | Version: 7.11 Resolution: | Keywords: Operating System: Unknown/Multiple | Architecture: Type of failure: Other | Unknown/Multiple Blocked By: | Test Case: Related Tickets: #10056 | Blocking: | Differential Revisions: -------------------------------------+------------------------------------- Changes (by goldfire): * related: => #10056 Comment: See comment:4:ticket:10056. The last point there explains, essentially, why this is happening. Both #10056 and this ticket have the same resolution. I'm not quite labeling this a duplicate of #10056, because this is worth a separate regression test. -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/10059#comment:1 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#10059: :i doesn't work for ~ -------------------------------------+------------------------------------- Reporter: dfeuer | Owner: Type: bug | Status: new Priority: normal | Milestone: Component: GHCi | Version: 7.11 Resolution: | Keywords: Operating System: Unknown/Multiple | Architecture: | Unknown/Multiple Type of failure: Other | Test Case: Blocked By: | Blocking: Related Tickets: #10056 | Differential Revisions: -------------------------------------+------------------------------------- Changes (by RyanGlScott): * cc: RyanGlScott (added) -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/10059#comment:2 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#10059: :i doesn't work for ~ -------------------------------------+------------------------------------- Reporter: dfeuer | Owner: (none) Type: bug | Status: new Priority: normal | Milestone: Component: GHCi | Version: 7.11 Resolution: | Keywords: Operating System: Unknown/Multiple | Architecture: | Unknown/Multiple Type of failure: Other | Test Case: Blocked By: | Blocking: Related Tickets: #10056, #12023 | Differential Rev(s): Wiki Page: | -------------------------------------+------------------------------------- Changes (by RyanGlScott): * related: #10056 => #10056, #12023 -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/10059#comment:3 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#10059: :i doesn't work for ~ -------------------------------------+------------------------------------- Reporter: dfeuer | Owner: (none) Type: bug | Status: new Priority: normal | Milestone: Component: GHCi | Version: 7.11 Resolution: | Keywords: Operating System: Unknown/Multiple | Architecture: | Unknown/Multiple Type of failure: Other | Test Case: Blocked By: | Blocking: Related Tickets: #10056, #12023 | Differential Rev(s): Wiki Page: | -------------------------------------+------------------------------------- Comment (by RyanGlScott): After some digging, it turns out that the reason this doesn't work is because the `identifier` parser production doesn't catch `(~)`. It turns out that this patch: {{{#!diff diff --git a/compiler/parser/Parser.y b/compiler/parser/Parser.y index c6face8..06a5722 100644 --- a/compiler/parser/Parser.y +++ b/compiler/parser/Parser.y @@ -629,6 +629,8 @@ identifier :: { Located RdrName } | qconop { $1 } | '(' '->' ')' {% ams (sLL $1 $> $ getRdrName funTyCon) [mj AnnOpenP $1,mu AnnRarrow $2,mj AnnCloseP $3] } + | '(' '~' ')' {% ams (sLL $1 $> $ eqTyCon_RDR) + [mop $1,mj AnnTilde $2,mcp $3] } ----------------------------------------------------------------------------- -- Backpack stuff }}} Is enough to make `:info (~)` go through: {{{ λ> :info (~) class (a ~ b) => (~) (a :: k) (b :: k) -- Defined in ‘Data.Type.Equality’ instance [incoherent] forall k (a :: k) (b :: k). (a ~ b) => a ~ b -- Defined in ‘Data.Type.Equality’ }}} (The pretty-printing of the class definition of `(~)` is gnarly, though—I'm still figuring out how to work around that.) -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/10059#comment:4 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#10059: :i doesn't work for ~ -------------------------------------+------------------------------------- Reporter: dfeuer | Owner: (none) Type: bug | Status: new Priority: normal | Milestone: Component: GHCi | Version: 7.11 Resolution: | Keywords: Operating System: Unknown/Multiple | Architecture: | Unknown/Multiple Type of failure: Other | Test Case: Blocked By: | Blocking: Related Tickets: #10056, #12023 | Differential Rev(s): Wiki Page: | -------------------------------------+------------------------------------- Comment (by RyanGlScott): Then again, it turns out that the `:info` output for `(~~)` is similarly broken: {{{ GHCi, version 8.4.3: http://www.haskell.org/ghc/ :? for help Loaded GHCi configuration from /home/rgscott/.ghci λ> import Data.Type.Equality λ> :i (~~) class ((a :: k0) ~~ (b :: k1)) => (~~) (a :: k0) (b :: k1) -- Defined in ‘GHC.Types’ }}} -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/10059#comment:5 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#10059: :i doesn't work for ~ -------------------------------------+------------------------------------- Reporter: dfeuer | Owner: (none) Type: bug | Status: new Priority: normal | Milestone: Component: GHCi | Version: 7.11 Resolution: | Keywords: Operating System: Unknown/Multiple | Architecture: | Unknown/Multiple Type of failure: Other | Test Case: Blocked By: | Blocking: Related Tickets: #10056, #12023 | Differential Rev(s): Wiki Page: | -------------------------------------+------------------------------------- Comment (by goldfire): Both `:info`s look correct to me. Turn on `-fprint-equality-relations` to get better output. I don't know how to do better, given `-fprint-equality- relations`. -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/10059#comment:6 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#10059: :i doesn't work for ~ -------------------------------------+------------------------------------- Reporter: dfeuer | Owner: (none) Type: bug | Status: patch Priority: normal | Milestone: Component: GHCi | Version: 7.11 Resolution: | Keywords: Operating System: Unknown/Multiple | Architecture: | Unknown/Multiple Type of failure: Other | Test Case: Blocked By: | Blocking: Related Tickets: #10056, #12023 | Differential Rev(s): Phab:D4877 Wiki Page: | -------------------------------------+------------------------------------- Changes (by RyanGlScott): * status: new => patch * differential: => Phab:D4877 Comment: In that case, let's do this! -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/10059#comment:7 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#10059: :i doesn't work for ~
-------------------------------------+-------------------------------------
Reporter: dfeuer | Owner: (none)
Type: bug | Status: patch
Priority: normal | Milestone:
Component: GHCi | Version: 7.11
Resolution: | Keywords:
Operating System: Unknown/Multiple | Architecture:
| Unknown/Multiple
Type of failure: Other | Test Case:
Blocked By: | Blocking:
Related Tickets: #10056, #12023 | Differential Rev(s): Phab:D4877
Wiki Page: |
-------------------------------------+-------------------------------------
Comment (by Ben Gamari

#10059: :i doesn't work for ~ -------------------------------------+------------------------------------- Reporter: dfeuer | Owner: (none) Type: bug | Status: merge Priority: normal | Milestone: 8.6.1 Component: GHCi | Version: 7.11 Resolution: | Keywords: Operating System: Unknown/Multiple | Architecture: | Unknown/Multiple Type of failure: Other | Test Case: | ghci/scripts/T10059 Blocked By: | Blocking: Related Tickets: #10056, #12023 | Differential Rev(s): Phab:D4877 Wiki Page: | -------------------------------------+------------------------------------- Changes (by RyanGlScott): * status: patch => merge * testcase: => ghci/scripts/T10059 * milestone: => 8.6.1 Comment: This could be merged to GHC 8.6 if desired. -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/10059#comment:9 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#10059: :i doesn't work for ~ -------------------------------------+------------------------------------- Reporter: dfeuer | Owner: (none) Type: bug | Status: closed Priority: normal | Milestone: 8.6.1 Component: GHCi | Version: 7.11 Resolution: fixed | Keywords: Operating System: Unknown/Multiple | Architecture: | Unknown/Multiple Type of failure: Other | Test Case: | ghci/scripts/T10059 Blocked By: | Blocking: Related Tickets: #10056, #12023 | Differential Rev(s): Phab:D4877 Wiki Page: | -------------------------------------+------------------------------------- Changes (by bgamari): * status: merge => closed * resolution: => fixed Comment: This is in 8.6. -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/10059#comment:10 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler
participants (1)
-
GHC