Language extensions - backwards compatibility

Don Stewart dons at galois.com
Thu Jan 28 18:45:33 EST 2010


ia:
> I'm looking for a way of specifying language extensions in a way which will 
> work in all versions of GHC from 6.4 onwards.  
> 
> GHC 6.4 does not support the LANGUAGE pragma.  Specifying language options in 
> the OPTIONS_GHC pragma starts to produce deprecation warnings in 6.10, and will 
> presumably eventually fail altogether.  
> 
> Any sort of preprocessing at the beginning of a file appears to insert enough 
> noise to inhibit recognition of file-header pragmas. (Cpphs doesn't appear to 
> help here.) Attempting preprocessing inside a leading OPTIONS_GHC pragma fails 
> because it apparently attempts to interpret the pragma *before* invoking the 
> preprocessor.  
> 
> The only remaining option I can see is to have a completely separate version of 
> the file for GHC 6.4.  Have I missed anything?  

Could you talk a bit about why you need to support 6.4 onwards -- that
seems like quite a burden. Is the effort worth it?


More information about the Glasgow-haskell-users mailing list