[GHC] #15675: Type operators in existential context cannot be parsed
#15675: Type operators in existential context cannot be parsed -------------------------------------+------------------------------------- Reporter: int-index | Owner: (none) Type: bug | Status: new Priority: normal | Milestone: 8.8.1 Component: Compiler | Version: 8.4.3 (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: -------------------------------------+------------------------------------- {{{#!haskell {-# LANGUAGE TypeOperators, MultiParamTypeClasses, ExistentialQuantification #-} class a + b data D1 = forall a b. (a + b) => D1 a b data D2 = forall a b. a + b => D2 a b }}} The declaration `D1` is accepted, while `D2` is rejected. There is no reason to reject `D2` except for shortcomings of the current grammar. -- Ticket URL: <http://ghc.haskell.org/trac/ghc/ticket/15675> GHC <http://www.haskell.org/ghc/> The Glasgow Haskell Compiler
#15675: Type operators in existential context cannot be parsed -------------------------------------+------------------------------------- Reporter: int-index | Owner: int-index Type: bug | Status: new Priority: normal | Milestone: 8.8.1 Component: Compiler | Version: 8.4.3 (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): Phab:D5180 Wiki Page: | -------------------------------------+------------------------------------- Changes (by int-index): * owner: (none) => int-index * differential: => Phab:D5180 -- Ticket URL: <http://ghc.haskell.org/trac/ghc/ticket/15675#comment:1> GHC <http://www.haskell.org/ghc/> The Glasgow Haskell Compiler
#15675: Type operators in existential context cannot be parsed -------------------------------------+------------------------------------- Reporter: int-index | Owner: int-index Type: bug | Status: new Priority: normal | Milestone: 8.8.1 Component: Compiler | Version: 8.4.3 (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): Phab:D5180 Wiki Page: | -------------------------------------+------------------------------------- Comment (by Ryan Scott <ryan.gl.scott@…>): In [changeset:"bd7898537768f936d05c0c83eef1cd9b00933347/ghc" bd789853/ghc]: {{{ #!CommitTicketReference repository="ghc" revision="bd7898537768f936d05c0c83eef1cd9b00933347" Parse the (!) type operator and allow type operators in existential context Summary: Improve the way `(!)`, `(~)`, and other type operators are handled in the parser, fixing two issues at once: 1. `(!)` can now be used as a type operator that respects fixity and precedence (#15457) 2. Existential context of a data constructor no longer needs parentheses (#15675) In addition to that, with this patch it is now trivial to adjust precedence of the `{-# UNPACK #-}` pragma, as suggested in https://ghc.haskell.org/trac/ghc/ticket/14761#comment:7 There was a small change to API Annotations. Before this patch, `(~)` was a strange special case that produced an annotation unlike any other type operator. After this patch, when `(~)` or `(!)` are used to specify strictness they produce AnnTilde and AnnBang annotations respectively, and when they are used as type operators, they produce no annotations. Test Plan: Validate Reviewers: simonpj, bgamari, alanz, RyanGlScott Reviewed By: RyanGlScott Subscribers: RyanGlScott, rwbarton, mpickering, carter GHC Trac Issues: #15457, #15675 Differential Revision: https://phabricator.haskell.org/D5180 }}} -- Ticket URL: <http://ghc.haskell.org/trac/ghc/ticket/15675#comment:2> GHC <http://www.haskell.org/ghc/> The Glasgow Haskell Compiler
#15675: Type operators in existential context cannot be parsed -------------------------------------+------------------------------------- Reporter: int-index | Owner: int-index Type: bug | Status: closed Priority: normal | Milestone: 8.8.1 Component: Compiler | Version: 8.4.3 (Parser) | Resolution: fixed | Keywords: Operating System: Unknown/Multiple | Architecture: | Unknown/Multiple Type of failure: GHC rejects | Test Case: valid program | parser/should_compile/T15675 Blocked By: | Blocking: Related Tickets: | Differential Rev(s): Phab:D5180 Wiki Page: | -------------------------------------+------------------------------------- Changes (by RyanGlScott): * status: new => closed * testcase: => parser/should_compile/T15675 * resolution: => fixed -- Ticket URL: <http://ghc.haskell.org/trac/ghc/ticket/15675#comment:3> GHC <http://www.haskell.org/ghc/> The Glasgow Haskell Compiler
#15675: Type operators in existential context cannot be parsed -------------------------------------+------------------------------------- Reporter: int-index | Owner: int-index Type: bug | Status: closed Priority: normal | Milestone: 8.8.1 Component: Compiler | Version: 8.4.3 (Parser) | Resolution: fixed | Keywords: Operating System: Unknown/Multiple | Architecture: | Unknown/Multiple Type of failure: GHC rejects | Test Case: valid program | parser/should_compile/T15675 Blocked By: | Blocking: Related Tickets: | Differential Rev(s): Phab:D5180 Wiki Page: | -------------------------------------+------------------------------------- Comment (by simonpj): Thanks for doing this Vladislav. I think you plan to nail #1087 in the same way, which would be even better. -- Ticket URL: <http://ghc.haskell.org/trac/ghc/ticket/15675#comment:4> GHC <http://www.haskell.org/ghc/> The Glasgow Haskell Compiler
participants (1)
-
GHC