If what you are trying to achieve is shortening your import list, you may try the following trick. Create a new module (Foo
):
module Foo (module X) where
import A as X
import B as X
import C as X
Then import this module to get all members of A
, B
, and C
:
module Bar where
import qualified Foo as X
This way you can combine modules which are commonly used throughout your project.
If you still need to auto-generate the imports, at least you only need to generate module Foo
, but not Bar
. So the automatically and manually generated code is separated cleanly.