- '--package'
- 'foo-1.0.0 with (X as Foo1.X)'
- '--package'
- 'foo-2.0.0 with (X as Foo2.X)'
Wrt the above, if I need to import multiple modules from each dar (which is the case more often than not), do i need to have a separate line per module, or is there a way I could import multiple modules per package-import:
- 'foo-1.0.0 with (X as Foo1.X, Y as Foo1.Y, Z as Foo1.Z)'
- 'foo-2.0.0 with (X as Foo2.X, Y as Foo2.Y, Z as Foo2.Z)'
Grepping the DAML code for --package shows that this is controlled by a construct called ModRenaming. Further grepping shows that it is defined in a module called DynFlags, which is nowhere to be found in the daml source tree. This suggests the feature is imported directly from GHC; googling “ghc dynflags” yields this page, where the form
-package foo with (A as B) is ModRenaming True [(A, B)]
strongly suggests there must be a way to do what you want, as otherwise why would that last bit be a list?
Similarly, -package "base (Data.Bool as Bool)" -package "base (Data.List as List)" is equivalent to -package "base (Data.Bool as Bool, Data.List as List)" .
which I believe answers your question: yes you can do exactly what you suggested.