I am a bit confused about using definitions from one SML file in another SML file in a SML project that I compile with CM. It seems like A.sml
can only use signature and structure definitions from B.sml
if they have been declared in the project.cm
file.
I want to declare a datatype MyType = MyConstr {name:string, other: string}
in B.sml
, and construct values of that type MyType
in A.sml
. If I understand the CM docs right, I can only export structures, signatures, functors and functor signatures. This sounds fairly limiting in terms of code reuse.
Now, does that mean that my MyType
would need to be part of a structure of signature, so that I can use it from another module?
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…