[GHC] #3647: unify handling and error messages for -X vs. {-#LANGUAGE ...#-} pragmas/extensions

GHC trac at galois.com
Mon Nov 9 16:23:28 EST 2009


#3647: unify handling and error messages for -X vs. {-#LANGUAGE ...#-}
pragmas/extensions
--------------------------------------------------------------+-------------
 Reporter:  eflister                                          |          Owner:                  
     Type:  feature request                                   |         Status:  new             
 Priority:  normal                                            |      Milestone:                  
Component:  Compiler (Parser)                                 |        Version:  6.10.4          
 Severity:  trivial                                           |     Resolution:                  
 Keywords:  language pragma extensions error message warning  |       Testcase:                  
       Os:  Unknown/Multiple                                  |   Architecture:  Unknown/Multiple
--------------------------------------------------------------+-------------
Comment (by duncan):

 Replying to [comment:2 eflister]:
 > not to be annoying, but i don't understand why it's not ok for ghc to
 accept (with a warning) a SUPERSET of the official syntax.

 At first you'd expect that accepting a superset would not cause any
 problems. However what happens is that people will start using that new
 syntax and then suddenly those packages/programs cannot be used with the
 tools that stick to the official syntax.

 > that doesn't change the standard and it doesn't imply that any other
 compiler has to do anything different.

 It doesn't change the official standard but it does change the de-facto
 standard, and other compilers and tools will have to change to keep up so
 that they can continue to process all code that people write.

 > a warning would be the best user interaction -- "i know what you meant
 to say, and i'm doing it, you should just know that what you said isn't
 portable, and here's how to fix it.  would you like me to fix it for you?"

 Certainly a nice error message is good however I would suggest that it be
 "i know what you meant to say, here's how to fix it." (and perhaps an IDE
 could also do "would you like me to fix it for you?"). Also accepting the
 program has a low benefit and a non-trivial cost.

-- 
Ticket URL: <http://hackage.haskell.org/trac/ghc/ticket/3647#comment:3>
GHC <http://www.haskell.org/ghc/>
The Glasgow Haskell Compiler


More information about the Glasgow-haskell-bugs mailing list