相关疑难解决方法(0)

跨编译单元的 OCaml 递归模块

我试图将以下递归模块拆分为单独的编译单元。具体来说,我希望 B 位于它自己的 b.ml 中,以便能够与其他 A 一起重用它。

module type AT = sig
  type b
  type t = Foo of b | Bar
  val f : t -> b list
end

module type BT = sig
  type a
  type t = { aaa: a list; bo: t option }
  val g : t -> t list
end

module rec A : (AT with type b = B.t) = struct
  type b = B.t
  type t = Foo of b | Bar …
Run Code Online (Sandbox Code Playgroud)

recursion ocaml module functor

5
推荐指数
1
解决办法
563
查看次数

标签 统计

functor ×1

module ×1

ocaml ×1

recursion ×1