For reference, there’s already a Haskell preprocessor require
that implements the desired syntax.
Instead of
import Data.Text (Text)
import qualified Data.Text as Text
import Data.ByteString (ByteString)
import qualified Data.ByteString as ByteString
You can write:
require Data.Text
require Data.ByteString
It has all the pros and cons of being an external compiler plugin instead of being a GHC feature.