[Haskell] -compiler-options vs {#-LANGUAGE Flags-#}

Stefan O'Rear stefanor at cox.net
Thu Apr 5 13:53:31 EDT 2007


On Thu, Apr 05, 2007 at 10:42:09AM -0700, John Meacham wrote:
> On Sat, Mar 24, 2007 at 01:18:30PM +0100, Lennart Kolmodin wrote:
> > I think the LANGUAGE pragma is much better than OPTIONS_GHC, for several
> > reasons.
> > 
> > * It's compiler independent.
> > * It's clear that you're only adding extensions, not any random compiler
> > flag.
> > * It plays nicely with Ian's proposal on
> > http://article.gmane.org/gmane.comp.lang.haskell.cabal.devel/464
> 
> A very big problem with the pragma as it relates to
> Distribution.Extension is that it is unextensable. The definition in
> Distribution.Extension really should be 
> 
> > newtype Extension = Extension String
> 
> and the flags transformation should be something like
> 
> > extensionsToFlags :: Compiler -> [Extension] -> ([Extension],[Opt])
> > extensionsToFlags = ...
> 
> enumerating the compilers or allowed extensions in the API is very
> limiting as well as complicating to the code.
> 
> This is a major problem with Distribution.* in general actually that
> needs to be cleaned up at some point. (Distribution2.* ?) hrm..

It would be a Very Good Idea to list the "valid" values in the
haddocks, to ensure consistency.  We can handle assignment with a
"Find a missing extension?  Invent a name and patch this list!"
clause. 

Stefan


More information about the Haskell mailing list