You can still use extensions: DeriveFunctor
in your .cabal file. Yes, it is not an extension that is currently known to Cabal, but you can still use it and as long as the compiler recognises it then it will work. Indeed Cabal will check that the compiler does recognise the extension, even though Cabal does not itself know about it.
There is a central registry of extensions in the module Language.Haskell.Extension
. The purpose of this registry is so that different compilers can agree on the same names when they implement the same extensions. We have had cases in the past where authors of different compilers have accidentally given different names to the same extension concept. Not all extensions need to be registered. It makes sense not to register extensions that are still highly experimental, for example the DPH extensions "PArr" is still not registered. Hackage requires all uploaded packages to use only known registered extensions, which makes sense since if an extension is sufficiently ready to be used in a distributed package, then it is ok to register.
In this particular case, the GHC devs appear to have forgotten to register the extension.
It is also worth noting that as of Cabal-1.10 the extensions
field is being split into two: default-extensions
and other-extensions
. This addresses the issue that John points out in his answer, that the previous behaviour is that all extensions are active for all modules, which we acknowledge is a mistake. The other-extensions
field allows the extensions used in some modules (i.e. with the LANGUAGE
pragma) to be listed. Cabal will eventually enforce that they are all listed, just like it requires that all package dependencies are listed. Language dependencies are dependencies too.