[GHC] #8815: confusing language in error message

#8815: confusing language in error message ------------------------------------+------------------------------------- Reporter: carter | Owner: Type: bug | Status: new Priority: normal | Milestone: Component: Compiler | Version: 7.8.1-rc1 Keywords: | Operating System: Unknown/Multiple Architecture: Unknown/Multiple | Type of failure: None/Unknown Difficulty: Unknown | Test Case: Blocked By: | Blocking: Related Tickets: | ------------------------------------+------------------------------------- Late last night I was finding myself very confused by the following (in retrospect obvious error message) {{{ src/Numerical/OpenBLAS/BLAS.hs:41:44: A pattern match on a GADT requires GADTs or TypeFamilies In the pattern: SRow In the pattern: DenseMatrix SRow _ _ _ _ In an equation for ‛encodeNiceOrderHelper’: encodeNiceOrderHelper (DenseMatrix SRow _ _ _ _) = encodeOrder BLASRowMajor }}} the error is correct per se, but reading (at least late at night) made me think "wait, how is my type not a GADT or TypeFamily?!!?!" I'm thinking (perhaps ) that ``` A pattern match on a GADT requires GADTs or TypeFamilies `` ` could perhaps be more clearly communicated as ```A pattern match on a GADT requires that GADTs or TypeFamilies Language extensions be enabled in the use site module``` (or something similar) relatedly: whats the current reasoning for why GADT related matching logic isn't enabled in client modules that use GADTs? (i'm not questioning it, just wondering why) -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/8815 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#8815: confusing language in error message -------------------------------------+------------------------------------ Reporter: carter | Owner: Type: bug | Status: new Priority: normal | Milestone: Component: Compiler | Version: 7.8.1-rc1 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 schyler): Most of the other error messages of this form mention the extensions in command line form, i.e. -XGADTs or -XTypeFamilies. Maybe it would be better to keep the error nice and short like so; `A pattern match on a GADT requires -XGADTs or -XTypeFamilies` The `-X` is uniform with all the other errors, and this hints an extension. -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/8815#comment:1 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#8815: confusing language in error message -------------------------------------+------------------------------------ Reporter: carter | Owner: Type: bug | Status: new Priority: normal | Milestone: Component: Compiler | Version: 7.8.1-rc1 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): See very relevant discussion in #3647. It was decided that removing the `-X` from error messages made copy-and-paste into `LANGUAGE` pragmas easier. Perhaps surrounding extensions in error messages with quotes would be a happy medium? -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/8815#comment:2 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#8815: confusing language in error message -------------------------------------+------------------------------------ Reporter: carter | Owner: Type: bug | Status: new Priority: normal | Milestone: Component: Compiler | Version: 7.8.1-rc1 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): Personally, I would have stuck with the previous `-XTypeFamilies` form in error messages, because it's an unambiguous clue that this is a language pragma. I suppose that (more verbosely) one could say `extension TypeFamilies` in error messages. But this is a user issue, so I didn't protest for #3647. If someone wants to re-open the question and gather opinions from users, I'm happy for GHC to adopt the result. Simon -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/8815#comment:3 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#8815: confusing language in error message -------------------------------------+------------------------------------- Reporter: carter | Owner: Type: bug | Status: new Priority: normal | Milestone: Component: Compiler | Version: 7.8.1-rc1 Resolution: | Keywords: newcomer Operating System: | Architecture: Unknown/Multiple Unknown/Multiple | Difficulty: Unknown Type of failure: | Blocked By: None/Unknown | Related Tickets: Test Case: | Blocking: | Differential Revisions: | -------------------------------------+------------------------------------- Changes (by jstolarek): * keywords: => newcomer -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/8815#comment:4 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#8815: confusing language in error message -------------------------------------+------------------------------------- Reporter: carter | Owner: Type: bug | Status: new Priority: normal | Milestone: Component: Compiler | Version: 7.8.1-rc1 Resolution: | Keywords: newcomer Operating System: | Architecture: Unknown/Multiple Unknown/Multiple | Difficulty: Unknown Type of failure: | Blocked By: None/Unknown | Related Tickets: Test Case: | Blocking: | Differential Revisions: | -------------------------------------+------------------------------------- Comment (by cactus): Maybe {{{ src/Numerical/OpenBLAS/BLAS.hs:41:44: A pattern match on a GADT requires {-# LANGUAGE GADTs #-} or {-# LANGUAGE TypeFamilies #-} }}} ? -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/8815#comment:5 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#8815: confusing language in error message -------------------------------------+------------------------------------- Reporter: carter | Owner: sivteck Type: bug | Status: new Priority: normal | Milestone: Component: Compiler | Version: 7.8.1-rc1 Resolution: | Keywords: newcomer Operating System: | Architecture: Unknown/Multiple Unknown/Multiple | Difficulty: Unknown Type of failure: | Blocked By: None/Unknown | Related Tickets: Test Case: | Blocking: | Differential Revisions: | -------------------------------------+------------------------------------- Changes (by sivteck): * owner: => sivteck -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/8815#comment:7 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#8815: confusing language in error message -------------------------------------+------------------------------------- Reporter: carter | Owner: sivteck Type: bug | Status: new Priority: normal | Milestone: Component: Compiler | Version: 7.8.1-rc1 Resolution: | Keywords: newcomer Operating System: | Architecture: Unknown/Multiple Unknown/Multiple | Difficulty: Unknown Type of failure: | Blocked By: None/Unknown | Related Tickets: Test Case: | Blocking: | Differential Revisions: | https://phabricator.haskell.org/D533| -------------------------------------+------------------------------------- Changes (by sivteck): * differential: => https://phabricator.haskell.org/D533 -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/8815#comment:8 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#8815: confusing language in error message -------------------------------------+------------------------------------- Reporter: carter | Owner: sivteck Type: bug | Status: new Priority: normal | Milestone: Component: Compiler | Version: 7.8.1-rc1 Resolution: | Keywords: newcomer Operating System: | Architecture: Unknown/Multiple Unknown/Multiple | Difficulty: Unknown Type of failure: | Blocked By: None/Unknown | Related Tickets: Test Case: | Blocking: | Differential Revisions: Phab:D533 | -------------------------------------+------------------------------------- Changes (by sivteck): * differential: https://phabricator.haskell.org/D533 => Phab:D533 -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/8815#comment:9 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#8815: confusing language in error message
-------------------------------------+-------------------------------------
Reporter: carter | Owner: sivteck
Type: bug | Status: new
Priority: normal | Milestone:
Component: Compiler | Version: 7.8.1-rc1
Resolution: | Keywords: newcomer
Operating System: | Architecture: Unknown/Multiple
Unknown/Multiple | Difficulty: Unknown
Type of failure: | Blocked By:
None/Unknown | Related Tickets:
Test Case: |
Blocking: |
Differential Revisions: Phab:D533 |
-------------------------------------+-------------------------------------
Comment (by Austin Seipp

#8815: confusing language in error message -------------------------------------+------------------------------------- Reporter: carter | Owner: sivteck Type: bug | Status: closed Priority: normal | Milestone: Component: Compiler | Version: 7.8.1-rc1 Resolution: fixed | Keywords: newcomer Operating System: | Architecture: Unknown/Multiple Unknown/Multiple | Difficulty: Unknown Type of failure: | Blocked By: None/Unknown | Related Tickets: Test Case: | Blocking: | Differential Revisions: Phab:D533 | -------------------------------------+------------------------------------- Changes (by sivteck): * status: new => closed * resolution: => fixed -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/8815#comment:11 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler
participants (1)
-
GHC