I might be completely and utterly wrong here, but isn’t this achievable if we break the whole compilation unit = file = module
thing, specifically the file = module
part?
I imagine if you had the file Foo/Mod.hs
and then Mod.hs
looks like this
module Foo where
...
Would that achieve what OP is asking for?
Not to imply at all that it’s so easy to do or anything, just asking theoretically