[GHC] #12023: Problems getting information and kind from GHC.Prim ~#, ~R#, ...

#12023: Problems getting information and kind from GHC.Prim ~#, ~R#, ... -------------------------------------+------------------------------------- Reporter: Iceland_jack | Owner: Type: bug | Status: new Priority: normal | Milestone: Component: GHCi | Version: 7.10.3 Keywords: | Operating System: Unknown/Multiple Architecture: | Type of failure: None/Unknown Unknown/Multiple | Test Case: | Blocked By: Blocking: | Related Tickets: Differential Rev(s): | Wiki Page: -------------------------------------+------------------------------------- {{{
import GHC.Prim :bro GHC.Prim [...] type role (~#) nominal nominal data (~#) (t3 :: a) (t4 :: b) type role ~P# phantom phantom data ~P# (t3 :: a) (t4 :: b) type role (~R#) representational representational data (~R#) (t3 :: a) (t4 :: b) }}}
getting the kind of `~`, `~#`, `~~` works fine: {{{
import GHC.Prim import GHC.Types
:kind (~) (~) :: k -> k -> Constraint :kind (~#) (~#) :: a -> b -> TYPE 'VoidRep :kind (~~) (~~) :: j -> k -> Constraint }}}
but `#` gets incorrectly treated as an operator in `~R#` and `~P#`: {{{
:kind (~R#)
<interactive>:1:3: error: Illegal operator ‘#’ in type ‘~R #’ Use TypeOperators to allow operators in types <interactive>:1:3: error: Operator applied to too few arguments: ~R # <interactive>:1:4: error: Not in scope: type constructor or class ‘R’ }}} Furthermore while running `:info` on `~~` and `~#` works fine {{{
:info (~~) class a ~# b => (~~) (a :: j) (b :: k) -- Defined in ‘GHC.Types’
:info (~#) type role (~#) nominal nominal data (~#) (t3 :: a) (t4 :: b) -- Defined in ‘GHC.Prim’ }}}
the others don't parse {{{
:info (~)
<interactive>:1:2: error: parse error on input ‘~’
:info (~R#)
<interactive>:1:2: error: parse error on input ‘~’
:info (~P#)
<interactive>:1:2: error: parse error on input ‘~’ }}} -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/12023 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#12023: Problems getting information and kind from GHC.Prim ~#, ~R#, ... -------------------------------------+------------------------------------- Reporter: Iceland_jack | Owner: (none) Type: bug | Status: new Priority: normal | Milestone: Component: GHCi | Version: 7.10.3 Resolution: | Keywords: Operating System: Unknown/Multiple | Architecture: | Unknown/Multiple Type of failure: None/Unknown | Test Case: Blocked By: | Blocking: Related Tickets: #10059, #15209 | Differential Rev(s): Wiki Page: | -------------------------------------+------------------------------------- Changes (by RyanGlScott): * related: => #10059, #15209 Comment: The fact that `:info` doesn't work for `(~)` is being tracked separately at #10059. I'm not surprised that `:info (~R#)` and `:info (~#P)` don't work, since I wouldn't expect users to be able to make use of these (see also #15209, which proposes to remove the ability to query `:info (~#)`.) It's a bit unfortunate that `:browse GHC.Prim` exposes `(~#)` and friends—perhaps we could alter `:browse` to avoid printing them. -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/12023#comment:1 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#12023: Problems getting information and kind from GHC.Prim ~#, ~R#, ... -------------------------------------+------------------------------------- Reporter: Iceland_jack | Owner: (none) Type: bug | Status: patch Priority: normal | Milestone: Component: GHCi | Version: 7.10.3 Resolution: | Keywords: Operating System: Unknown/Multiple | Architecture: | Unknown/Multiple Type of failure: None/Unknown | Test Case: Blocked By: | Blocking: Related Tickets: #10059, #15209 | Differential Rev(s): Phab:D4801 Wiki Page: | -------------------------------------+------------------------------------- Changes (by RyanGlScott): * status: new => patch * differential: => Phab:D4801 -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/12023#comment:2 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#12023: Problems getting information and kind from GHC.Prim ~#, ~R#, ...
-------------------------------------+-------------------------------------
Reporter: Iceland_jack | Owner: (none)
Type: bug | Status: patch
Priority: normal | Milestone:
Component: GHCi | Version: 7.10.3
Resolution: | Keywords:
Operating System: Unknown/Multiple | Architecture:
| Unknown/Multiple
Type of failure: None/Unknown | Test Case:
Blocked By: | Blocking:
Related Tickets: #10059, #15209 | Differential Rev(s): Phab:D4801
Wiki Page: |
-------------------------------------+-------------------------------------
Comment (by Ben Gamari

#12023: Problems getting information and kind from GHC.Prim ~#, ~R#, ... -------------------------------------+------------------------------------- Reporter: Iceland_jack | Owner: (none) Type: bug | Status: closed Priority: normal | Milestone: 8.6.1 Component: GHCi | Version: 7.10.3 Resolution: fixed | Keywords: Operating System: Unknown/Multiple | Architecture: | Unknown/Multiple Type of failure: None/Unknown | Test Case: Blocked By: | Blocking: Related Tickets: #10059, #15209 | Differential Rev(s): Phab:D4801 Wiki Page: | -------------------------------------+------------------------------------- Changes (by bgamari): * status: patch => closed * resolution: => fixed * milestone: => 8.6.1 -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/12023#comment:4 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler
participants (1)
-
GHC