Hello list,
I am building a library with nested modules. There happen to be certain functors within certain nested modules. Here is an example:
mylib/ml_bind.ML ==============
structure Mylib = struct structure B = B end
mylib/B/C.sml ==============
structure C = struct end (* Here so C.sml is discoverable *)
signature Sig = sig ... end
functor CFunctor (S: Sig) = struct ... end
mylib/B/ml_bind.ML ==============
structure B = struct local open C in end end
I want the CFunctor to be exported both inside the library and to the end-user using the library. This is the only way I could get the library to compile because Poly/ML (and the standard) does not support functors within structs or signatures. This works, but CFunctor is now in the "global" namespace - this is just really ugly.
Is there any way to get Poly/ML to export CFunctor within the Mylib.B namespace?
On a separate note, is there a namespace to access the Basis namespace? For instance if I redefine a String structure within Mylib and want to reference the basis String structure, I get a circular dependency error. I was able to solve this by explicitly creating a Basis structure with an internal structure String in my "build.sml" script that makes Mylib and the files that depend on it. However, I'd rather do this within the library itself and not rely on the user to provide this namespace.
Thank you!