【发布时间】:2014-11-06 04:10:47
【问题描述】:
使用一堆生成的 OCaml 文件,在不使用 .mli 文件的情况下定义顶级模块的签名会更简单,就像嵌套模块一样。例如在 Mymodule.ml 中可以这样写:
module self/this module : sig
... (* contents of the mli file *)
end =
struct
...
end
但我找不到执行此操作的语法。有没有可能?
【问题讨论】:
标签: ocaml
使用一堆生成的 OCaml 文件,在不使用 .mli 文件的情况下定义顶级模块的签名会更简单,就像嵌套模块一样。例如在 Mymodule.ml 中可以这样写:
module self/this module : sig
... (* contents of the mli file *)
end =
struct
...
end
但我找不到执行此操作的语法。有没有可能?
【问题讨论】:
标签: ocaml
您必须执行以下操作。我真的不知道为什么这会“更容易”,也许你应该提供更多细节来为你指明正确的方向。
module X : sig ... end =
struct
...
end
include X
【讨论】: