[Haskell] -compiler-options vs {#-LANGUAGE Flags-#}
John Meacham
john at repetae.net
Thu Apr 5 16:14:58 EDT 2007
On Thu, Apr 05, 2007 at 10:53:31AM -0700, Stefan O'Rear wrote:
> 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.
oh, yes of course. I was thinking a wiki page could list valid ones and
pointers to the papers/documentation describing them.
and of course, we can reserve X-Foo named extensions for as yet to be
standardized or experimental extensions so developers have a playground
to work in as extensions evolve.
John
--
John Meacham - ⑆repetae.net⑆john⑈
More information about the Haskell
mailing list