Two observations:
- Someone said something like this half jokingly : a “.hs” usually is half page of language extensions and imports.
- Within the same project, often the same language extensions are used through out files anyways.
For these, I had just a quick thought here, I am curious how you think about it:
module ProjectConfig
( module GHC.LanguageExtensions.TemplateHaskell
, module GHC.LanguageExtensions.TypeFamilies
, module GHC.LanguageExtensions.OverloadedString
...
) where
import GHC.LanguageExtensions.TypeFamilies
import GHC.LanguageExtensions.TemplateHaskell
import GHC.LanguageExtensions.OverloadedString
...
-------
{-# LANGUAGE ImportableExtensions #-}
module A
import ProjectConfig -- this imports all those extensions due to ImportableExtensions
Now:
- Language extensions can be in the import section of the program, some people may see that as less “offensive” than a laundry list of language extensions
- But also you could reexport them to other projects, or even the consumer of your library if they enables “ImportableExtensions” feature. That could shorten the file length of the downstream usages, and potentially make your libraries easier to use if your libraries require a myriads of fancy extensions…
- Some language extension could now benefit from the import syntax have “sub features” that you could further opt in.