我有一个包含嵌套模块的ML文件.例如:
let f n = n + 1
module type M_type = sig
val g : int -> int
val h : int -> int
end
module M : M_type = struct
let g n = n + 2
let h n = n + 3
end
let j n = n |> M.h |> M.g |> f
Run Code Online (Sandbox Code Playgroud)
在为ML编写MLI时,我希望不要公开M.h,但我希望揭露M.g.
如下:
module type M_type = sig
val g : int -> int
end
module M : M_type …Run Code Online (Sandbox Code Playgroud) ocaml ×1