我尝试使用 Oasis 编译一个小的 OCaml [4.03.0+flambda] 项目。我有四个模块,三个在 Modules 字段中声明,一个使用 InternalModules。我的 _oasis 配置文件在那里。
内部模块被命名为中缀,并包含一个子模块选项,它收集了一些有用的中缀运算符来处理选项类型。在当前 github 版本的代码(可在此处获得)中,一切正常,我能够构建项目。无论如何,如果我在源文件 agent.ml 中添加“open Infix.Option”行,它现在看起来像
[..LICENSE..]
open Lwt
open Cohttp
open Cohttp_lwt_unix
open Infix.Option
type http_status_code = Cohttp.Code.status_code
type http_headers = Cohttp.Header.t
[..]
我收到以下错误
+ /home/yann/.opam/4.03.0+flambda/bin/ocamlfind ocamlc -c -g -annot -bin-annot -package cohttp -package cohttp.lwt -package lambdasoup -package lwt -package uri -I src -o src/agent.cmo src/agent.ml
File "src/agent.ml", line 23, characters 5-17:
Error: Unbound module Infix.Option
这是出乎意料的,尤其是因为我当前的源文件 page.ml 执行相同的打开并使用 Infix.Open 运算符没有任何问题或错误。我想知道发生了什么以及为什么绿洲对 agent.ml 和 page.ml 的处理方式不同......