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

GHC ghc-devs at haskell.org
Wed Sep 11 18:28:37 CEST 2013


#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



More information about the ghc-tickets mailing list