[GHC] #8269: Suggest LANGUAGE pragmas instead of -XFoo

#8269: Suggest LANGUAGE pragmas instead of -XFoo ------------------------------------+------------------------------------- Reporter: nomeata | Owner: Type: feature request | Status: new Priority: normal | Milestone: Component: Compiler | Version: 7.6.3 Keywords: | Operating System: Unknown/Multiple Architecture: Unknown/Multiple | Type of failure: None/Unknown Difficulty: Unknown | Test Case: Blocked By: | Blocking: Related Tickets: | ------------------------------------+------------------------------------- Minor, but still: Currently GHC says: {{{ readFail037.hs:4:1: Too many parameters for class ‛Foo’ (Use -XMultiParamTypeClasses to allow multi-parameter classes) In the class declaration for ‛Foo’ }}} Maybe it is just me, but generally I find LANGUAGE pragmas are the way to go. So I think it should read {{{ readFail037.hs:4:1: Too many parameters for class ‛Foo’ (Use {-# LANGUAGE MultiParamTypeClasses #-} to allow multi-parameter classes) In the class declaration for ‛Foo’ }}} Note that it is easier to copying `MultiParamTypeClasses` (by double- clicking), entering "-X", and pasting, than copying `XMultiParamTypeClasses` and removing the X again. If noone complains or someone says that it is a good idea I’ll fix it myself. -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/8269 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#8269: Suggest LANGUAGE pragmas instead of -XFoo -------------------------------------+------------------------------------ Reporter: nomeata | Owner: Type: feature request | Status: new Priority: normal | Milestone: Component: Compiler | Version: 7.6.3 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): If you change this, grep for `-X` and change all of them. (There are a lot.) The reason I consistently used the `-X` form is simply that it's shorter in error messages. Simon -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/8269#comment:1 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#8269: Suggest LANGUAGE pragmas instead of -XFoo -------------------------------------+------------------------------------ Reporter: nomeata | Owner: Type: feature request | Status: new Priority: normal | Milestone: Component: Compiler | Version: 7.6.3 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 monoidal): We already have #3647. Close as duplicate? (My preference is that {-# LANGUAGE ... #-} makes the error too long, I would prefer merely "Use MultiParamTypeClasses pragma" or the status quo) No matter what we decide, it might be a good idea to have something like this: {{{ needPragma :: Flag -> SDoc needPragma x = "Use" <+> ptext (sLit (show flag)) <+> "to allow this" }}} and use it in error messages. That could be changed more easily and the error message would be more consistent. Currently we have different wordings {{{ Too many parameters for class ‛A’ (Use -XMultiParamTypeClasses to allow multi-parameter classes) Empty list of alterantives in case expression Use -XEmptyCase to allow this Multi-way if-expressions need -XMultiWayIf turned on ‛A’ has no constructors (-XEmptyDataDecls permits this) }}} that would make it consistent. -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/8269#comment:2 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#8269: Suggest LANGUAGE pragmas instead of -XFoo -------------------------------------+------------------------------------ Reporter: nomeata | Owner: Type: feature request | Status: closed Priority: normal | Milestone: Component: Compiler | Version: 7.6.3 Resolution: duplicate | Keywords: Operating System: Unknown/Multiple | Architecture: Unknown/Multiple Type of failure: None/Unknown | Difficulty: Unknown Test Case: | Blocked By: Blocking: | Related Tickets: 3647 -------------------------------------+------------------------------------ Changes (by nomeata): * status: new => closed * resolution: => duplicate * related: => 3647 Comment: I didn’t find the other ticket with a quick (probably too quick) search, so yes, this is a duplicate. Sorry for the noise. -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/8269#comment:3 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler
participants (1)
-
GHC