[GHC] #1921: change default to support extensions that involve a change of syntax

GHC trac at galois.com
Sat Nov 24 14:13:08 EST 2007


#1921: change default to support extensions that involve a change of syntax
-----------------------------+----------------------------------------------
 Reporter:  alex             |          Owner:         
     Type:  feature request  |         Status:  new    
 Priority:  normal           |      Milestone:         
Component:  Compiler         |        Version:  6.8.1  
 Severity:  normal           |     Resolution:         
 Keywords:                   |     Difficulty:  Unknown
 Testcase:                   |   Architecture:  Unknown
       Os:  Unknown          |  
-----------------------------+----------------------------------------------
Comment (by claus):

 defaults are always going to rub some users the wrong way. why not make it
 easier to specify what you want? i agree with the goal that a source file
 should have all the information needed to interpret it, so lets start with
 that:

  * currently, the default is haskell98, but there is no way to specify
 that a source should be haskell98, which is bad if haskell' ever succeeds.

  * there is no way to specify that a source should be haskell', which
 matches the general silence from that direction, but needs to be remedied
 at some point.

  * it used to be that `glasgow-exts` switched on all `ghc` extensions,
 which is bad because nobody knows what they are, for any given source file
 (`ghc` version dependent). it now switches on "most" `ghc` extensions,
 whatever that may mean for any particular version.

  * the recent trend is to have a flag for every single feature, which is
 less descriptive or portable than it might sound (`cabal` simply copies
 `ghc` extension names, `hugs` has different interpretations of shared
 extensions, such as overlapping instances combined with functional
 dependencies). it is also a real pain without support for abstraction.

 i think it would also be useful to distinguish between sources in
 development and release versions: the former want flexibility, the latter
 want preciseness. and i certainly do not want to repeat all those language
 flags from the sources for each `ghci` session!-)

 a few suggestions:
  - it would be nice to have shortcuts for typical combinations of
 features, including `Haskell98` and `Haskell98+FFI+Modules`, as well as
 `Haskell'<version>`.

  - it would be nice to be able to switch between development and release
 mode, where the former should enable all recognisable features (unless
 explicitly disabled), with warnings, while the latter should disable all
 unspecified features, with errors. the former would give the benefits of
 the old uses of `glasgow-exts`, the latter would remove their
 disadvantages. warnings and errors should be formatted in a way that
 enables ides/editors to insert the necessary flags in the source.

  - it would be nice to enable project-wide definitions of feature
 combinations, but that won't benefit single-source projects, and it would
 need to be easy to find the definitions (project.cabal file? separate
 project.extensions file?)

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


More information about the Glasgow-haskell-bugs mailing list