Add ghc(i) commandline-flag to provide LINE pragma mapping out-of-band
Motivation
Context: I use a non-standard directory structure for my Haskell files (a relatively flat layout), and separately reorganize them into Cabal packages before build. This lets me control my source layout and build instructions using a minimalistic approach, but still use Cabal for building.
The original approach was to create symlinks to my files, and place them in a directory structure mirroring the intended Cabal packages. This works fine, but when GHC emits warnings/errors, those refer to the mirrored sources, and naturally don't play nicely with editors etc.
The second approach was to actually copy the files, adding a LINE pragma to each of them, pointing to the true source location. This fixes sources pointing to the right place, at the expense of needing some kind of inotify daemon to copy over changed files. This seems to be slow and error-prone.
Proposal
To get the best of both worlds, I would like to keep symlinking the files, but also point GHC to a file that contains LINE mappings out-of-band.
Abstractly it would be pairs in a text file.