suggestion: add a .ehs file type

Alex Jacobson alex at alexjacobson.com
Thu Nov 22 10:31:18 EST 2007


It seems like use of a lot of extensions is so obvious from syntax that 
the compiler is able to suggest the correct pragma to turn on to enable 
that syntax.  In fact the way I know to use most of these pragmas is 
because the compiler told me about them.

So, my suggestion is that in any case where the compiler currently 
suggests use of a particular pragma in an error message, it should 
instead turn that pragma on and produce a warning.

Does that make sense?

-Alex-



Simon Peyton-Jones wrote:
> Alex,
> 
> | Ok, I'm game to default to haskell98 in the presence of ambiguity, but
> | in most cases the extension involves new syntax and that should be enough.
> 
> Trying to compile the program both ways (or 2^n ways) to check for ambiguity sounds like  a pretty heavy hammer to crack this nut.
> 
> GHC is a Haskell-98 compiler by default, and I think it's a good default.  You are arguing to change the default, but that's always an uphill battle because there will be others with good user-based reasons (like yours) for preferring the current default.
> 
> Better would be to make it easy to get what you want.  It is certainly useful to have a name for a bundle of flags.  Currently -O, -O2, and -fglasgow-exts, and -Wall are the only such names.
> 
> But we don't currently have a "switch on all extensions" flag, -Xall say.  If you'd find that useful, you could put {-# OPTIONS_GHC -Xall #-} at the top of all your modules, and you'd be done.  In situations where you didn't want a particular extension (like Duncan's example) you can switch it off selectively with -XNoBangPatterns.
> 
> Simon



More information about the Glasgow-haskell-users mailing list