I tried to create a library module according to the documentation here.
My understanding is that a library is just any daml
file that contains only imports, and then I would import that file instead of importing all the imported files where I want to use that library.
So I try to bundle a few files like Portfolio.daml
together into a library called Arbo.daml
.
I tried this at first:
module Arbo where
import qualified Portfolio
then this, after the error message that the import is redundant:
module Arbo where
import qualified Portfolio ()
and also this:
module Arbo where
import qualified Portfolio (Contract, Info, Key)
None of this works.
I get error message about those imports in the library:
Message:
./Arbo.daml:5:1: error:
The qualified import of ‘Portfolio’ is redundant
except perhaps to import instances from ‘Portfolio’
To import instances alone, use: import Portfolio()
If I follow the advice from the error message, I get this error from where I try to use the library:
Message:
./Arbo_Test.daml:96:40: error:
Not in scope: data constructor ‘Portfolio.Info’
No module named ‘Portfolio’ is imported.
I think an actual working example somewhere would help me understand this. Is there one?
Thanks a lot,
mesch.