[GHC] #16339: Cannot put (.) or (!) into an export list
#16339: Cannot put (.) or (!) into an export list -------------------------------------+------------------------------------- Reporter: RyanGlScott | Owner: (none) Type: bug | Status: new Priority: normal | Milestone: Component: Compiler | Version: 8.7 (Parser) | Keywords: | Operating System: Unknown/Multiple Architecture: | Type of failure: GHC rejects Unknown/Multiple | valid program Test Case: | Blocked By: Blocking: | Related Tickets: Differential Rev(s): | Wiki Page: -------------------------------------+------------------------------------- Thanks to recent work in GHC HEAD, it is now possible to define type operators named `(.)` and `(!)`: {{{#!hs type (f . g) x = f (g x) type x ! f = f x }}} However, I was surprised to discover that it's not possible to put them in an export list! That is to say, this program doesn't parse: {{{ {-# LANGUAGE TypeOperators #-} module Bug (type (.), type (!)) where type (f . g) x = f (g x) type x ! f = f x }}} {{{ $ ~/Software/ghc4/inplace/bin/ghc-stage2 --interactive Bug.hs GHCi, version 8.7.20190219: https://www.haskell.org/ghc/ :? for help Loaded GHCi configuration from /home/rgscott/.ghci Bug.hs:2:19: error: parse error on input ‘.’ | 2 | module Bug (type (.), type (!)) where | ^ }}} This problem appears to be specific to the `(.)` and `(!)` type operators, since any other type operator will work in its place: {{{#!hs {-# LANGUAGE TypeOperators #-} module Works (type (&)) where type (f & g) x = f (g x) }}} -- Ticket URL: <http://ghc.haskell.org/trac/ghc/ticket/16339> GHC <http://www.haskell.org/ghc/> The Glasgow Haskell Compiler
#16339: Cannot put (.) or (!) type operators into an export list -------------------------------------+------------------------------------- Reporter: RyanGlScott | Owner: (none) Type: bug | Status: new Priority: normal | Milestone: Component: Compiler | Version: 8.7 (Parser) | Resolution: | Keywords: Operating System: Unknown/Multiple | Architecture: Type of failure: GHC rejects | Unknown/Multiple valid program | Test Case: Blocked By: | Blocking: Related Tickets: | Differential Rev(s): Wiki Page: | -------------------------------------+------------------------------------- -- Ticket URL: <http://ghc.haskell.org/trac/ghc/ticket/16339#comment:1> GHC <http://www.haskell.org/ghc/> The Glasgow Haskell Compiler
#16339: Cannot put (.) or (!) type operators into an export list -------------------------------------+------------------------------------- Reporter: RyanGlScott | Owner: (none) Type: bug | Status: new Priority: normal | Milestone: Component: Compiler | Version: 8.7 (Parser) | Resolution: | Keywords: Operating System: Unknown/Multiple | Architecture: Type of failure: GHC rejects | Unknown/Multiple valid program | Test Case: Blocked By: | Blocking: Related Tickets: | Differential Rev(s): Wiki Page: | -------------------------------------+------------------------------------- Comment (by int-index): Bummer. Fix coming. -- Ticket URL: <http://ghc.haskell.org/trac/ghc/ticket/16339#comment:2> GHC <http://www.haskell.org/ghc/> The Glasgow Haskell Compiler
#16339: Cannot put (.) or (!) type operators into an export list -------------------------------------+------------------------------------- Reporter: RyanGlScott | Owner: (none) Type: bug | Status: patch Priority: normal | Milestone: Component: Compiler | Version: 8.7 (Parser) | Resolution: | Keywords: Operating System: Unknown/Multiple | Architecture: Type of failure: GHC rejects | Unknown/Multiple valid program | Test Case: Blocked By: | Blocking: Related Tickets: | Differential Rev(s): Wiki Page: | https://gitlab.haskell.org/ghc/ghc/merge_requests/403 -------------------------------------+------------------------------------- Changes (by int-index): * status: new => patch * differential: => https://gitlab.haskell.org/ghc/ghc/merge_requests/403 -- Ticket URL: <http://ghc.haskell.org/trac/ghc/ticket/16339#comment:3> GHC <http://www.haskell.org/ghc/> The Glasgow Haskell Compiler
#16339: Cannot put (.) or (!) type operators into an export list -------------------------------------+------------------------------------- Reporter: RyanGlScott | Owner: (none) Type: bug | Status: merge Priority: normal | Milestone: 8.8.1 Component: Compiler | Version: 8.7 (Parser) | Resolution: | Keywords: Operating System: Unknown/Multiple | Architecture: | Unknown/Multiple Type of failure: GHC rejects | Test Case: valid program | parser/should_compile/T16339 Blocked By: | Blocking: Related Tickets: #15457, #16311 | Differential Rev(s): Wiki Page: | https://gitlab.haskell.org/ghc/ghc/merge_requests/403 -------------------------------------+------------------------------------- Changes (by RyanGlScott): * status: patch => merge * testcase: => parser/should_compile/T16339 * related: => #15457, #16311 * milestone: => 8.8.1 Comment: Landed in [https://gitlab.haskell.org/ghc/ghc/commit/2f4af71e73ac3b59f4faba5bf1b25774b1... 2f4af71e73ac3b59f4faba5bf1b25774b1008898] and [https://gitlab.haskell.org/ghc/ghc/commit/e204431e5a5e2fd16da52b04bda2798f16... e204431e5a5e2fd16da52b04bda2798f16c51344]. These commits should be merged to GHC 8.8 alongside commit [https://gitlab.haskell.org/ghc/ghc/commit/887454d8889ca5dbba70425de41d97939c... 887454d8889ca5dbba70425de41d97939cb9ac60] from #16311. -- Ticket URL: <http://ghc.haskell.org/trac/ghc/ticket/16339#comment:4> GHC <http://www.haskell.org/ghc/> The Glasgow Haskell Compiler
#16339: Cannot put (.) or (!) type operators into an export list -------------------------------------+------------------------------------- Reporter: RyanGlScott | Owner: (none) Type: bug | Status: merge Priority: normal | Milestone: 8.8.1 Component: Compiler | Version: 8.7 (Parser) | Resolution: | Keywords: Operating System: Unknown/Multiple | Architecture: | Unknown/Multiple Type of failure: GHC rejects | Test Case: valid program | parser/should_compile/T16339 Blocked By: | Blocking: Related Tickets: #15457, #16311 | Differential Rev(s): Wiki Page: | https://gitlab.haskell.org/ghc/ghc/merge_requests/403 -------------------------------------+------------------------------------- Comment (by int-index): Note that the issue is fixed by 2f4af71e73ac3b59f4faba5bf1b25774b1008898 alone, which is why I left e204431e5a5e2fd16da52b04bda2798f16c51344 as a separate commit. -- Ticket URL: <http://ghc.haskell.org/trac/ghc/ticket/16339#comment:5> GHC <http://www.haskell.org/ghc/> The Glasgow Haskell Compiler
#16339: Cannot put (.) or (!) type operators into an export list -------------------------------------+------------------------------------- Reporter: RyanGlScott | Owner: (none) Type: bug | Status: merge Priority: normal | Milestone: 8.8.1 Component: Compiler | Version: 8.7 (Parser) | Resolution: | Keywords: Operating System: Unknown/Multiple | Architecture: | Unknown/Multiple Type of failure: GHC rejects | Test Case: valid program | parser/should_compile/T16339 Blocked By: | Blocking: Related Tickets: #15457, #16311 | Differential Rev(s): Wiki Page: | https://gitlab.haskell.org/ghc/ghc/merge_requests/403 -------------------------------------+------------------------------------- Comment (by Marge Bot <ben+marge-bot@…>): In [changeset:"2f4af71e73ac3b59f4faba5bf1b25774b1008898/ghc" 2f4af71e/ghc]: {{{ #!CommitTicketReference repository="ghc" revision="2f4af71e73ac3b59f4faba5bf1b25774b1008898" Dot/bang operators in export lists (Trac #16339) The dot type operator was handled in the 'tyvarop' parser production, and the bang type operator in 'tyapp'. However, export lists and role annotations use 'oqtycon', so these type operators could not be exported or assigned roles. The fix is to handle them in a lower level production, 'tyconsym'. }}} -- Ticket URL: <http://ghc.haskell.org/trac/ghc/ticket/16339#comment:6> GHC <http://www.haskell.org/ghc/> The Glasgow Haskell Compiler
participants (1)
-
GHC