suggestion: add a .ehs file type

Simon Marlow simonmarhaskell at
Thu Nov 22 04:09:21 EST 2007

Alex Jacobson wrote:
> Isn't use of the extensions detectable by the compiler?

Not always, no.  Some extensions modify the syntax, such that programs 
accepted with the extension turned on are not necessarily a superset of 
those accepted with the extension turned off.  For example: MagicHash 
(modifies the meaning of a # suffix on an identifier), RankNTypes (steals 
'forall' and '.' from the type-variable namespace), etc.


> If so, then forcing the user manually to enumerate them at the top of a 
> source file seems like forcing the user to write a lot of unnecessary 
> boilerplate.  It seems preferable for the compiler ny default just to 
> issue warnings about what extensions are used.  Then the person doing 
> the compiling can decide to modify code not to use those features, to 
> add pragmas so as not to cause warning, or to add compiler flags that 
> tells it not to issue them.
> In any case, I'm pretty sure the correct answer is not 50 language 
> pragmas with arbitrary spellings for various language features at the 
> top of each source file.
> -Alex-
> Simon Marlow wrote:
>> Alex Jacobson wrote:
>>> I'm fine with that as well.  I'm just opposed to being force to look 
>>> up the precise names the compiler happens to use for each language 
>>> extension I happen to use.  Having -fglasgow-exts turned on by 
>>> default also works.
>> -fglasgow-exts is a historical relic.  It's just an arbitrary 
>> collection of extensions.  It doesn't contain all the extensions 
>> provided by GHC, as many of them steal syntax and you probably don't 
>> want them all on at the same time.  We're trying to move away from 
>> -fglasgow-exts, which is why GHC 6.8.1 provides separate flags for all 
>> the extensions we provide. Eventually we'll have a new standard 
>> (Haskell' or whatever) that will collect many of the extensions 
>> together, so you'll just have to write {-# LANGUAGE Haskell' #-}.
>> Cheers,
>>     Simon
>> _______________________________________________
>> Glasgow-haskell-users mailing list
>> Glasgow-haskell-users at

More information about the Glasgow-haskell-users mailing list