- html - 出于某种原因,IE8 对我的 Sass 文件中继承的 html5 CSS 不友好?
- JMeter 在响应断言中使用 span 标签的问题
- html - 在 :hover and :active? 上具有不同效果的 CSS 动画
- html - 相对于居中的 html 内容固定的 CSS 重复背景?
我有 airport.mli
和 airport.ml
.
在 airport.ml
, 我有
module AirportSet = Set.Make(struct type t = airport let compare = compare end);;
val get_all_airport : unit -> AirportSet.t;;
AirportSet
.
airport.mli
, 我需要显示
module AirportSet
所以
AirportSet
被认可。
最佳答案
module AirportSet : (Set.S with type elt = airport)
sig ... end
)。
关于ocaml - 如何在 mli 文件中声明模块(实际上是 Set.Make)?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/16548069/
Menhir 允许将任意 ocaml 代码添加到 .mly 文件的末尾,我想在其中声明一些函数。但是我找不到让 menhir 将我的函数添加到 .mli 文件的方法,以便它们在其他模块中可见。可能吗?
我有以下情况: mli 文件 ds.mli 只包含一个类型声明: type t = A of int | B of string 现在我想在另一个模块 user.ml 中为 Ds 创建一个别名: mo
是否可以在不创建“必须实现的新模块”的情况下为 mli 中的模块添加别名?这个示例非常人为设计,但是,例如,假设我有以下源文件 int_wrapper.ml。 type t = Int64.t let
我可以在 mli 文件中包含库吗? 例如,假设我制作了以下 mli 文件 include Base val bluh : int -> int 我收到一个未绑定(bind)的模块 Base 错误。 但
我有一个文件 context.ml,其中定义了 map module CtxMap = Map.make(struct type t = int let compare = compare end)
好的,这主要是出于好奇,但我觉得太奇怪了。 假设我有这段代码 sig.mli type t = A | B main.ml let f = let open Sig in funct
我正在尝试了解有关 ocaml 模块及其编译的特定内容: 我是否被迫重新声明已在 .mli 中声明的类型?里面具体.ml实现? 举个例子: (* foo.mli *) type foobar = Bo
假设我有一些接口(interface)文件 mylib.mli 就像 var foo : 'a list -> int val bar : f:('a -> 'b) -> 'a l
我有一个包含 OCaml .ml 文件和 Menhir .mly 文件的项目。我使用 ocamlbuild 来编译项目。 我的 _tags 文件包含这一行: true: use_menhir, pac
我意识到您可以使用 ocamlbuild xxx.inferred.mli 一个一个地生成推断的 mli 文件,但我希望这可以为我自动完成(也可以查看 ocaml 推断的类型并使用这些 mli 作为我
这里我有一个文件set.ml带有一个名为 IntSet 的模块.如何引用模块IntSet里面对应的接口(interface)文件set.mli ? module IntSet = struct t
我最终要做的是 1) 限制对模块的可见性(因此是 mli 文件)和 2) 定义一个仿函数,其中参数具有作为 ml/mli 对并坚持认为参数与此规范实现具有相同的形状。 假设我有一个文件concat.m
我有一个 .ml文件,我想生成它的 .cmo , .cmx , .cmi和 .mli通过尽可能少的命令,有人可以帮忙吗? 最佳答案 我认为没有任何方法可以一次生成所有这些文件。 .mli : oc
我有 airport.mli和 airport.ml . 在 airport.ml , 我有 module AirportSet = Set.Make(struct type t = airport
简单地说,假设我有一个名为 moduleExample.ml 的实现文件。和同一目录中的接口(interface)文件 moduleExample.mli . 我怎样才能将它们加载在一起,以使界面中未
我想定义一个 keyword_table ,它将一些字符串映射到一些标记,并且我想让这个表对 parser.mly 和 都可见lexer.mll。 看来该表必须在parser.mly中定义, %{
我想在我生成的文档中包含源代码。这在我调用 ocamldoc 时有效在这样的命令行上:ocamldoc -I _build -html -keep-code -colorize-code *.{ml,
OCaml 提供 mli用于接口(interface)和模块系统。 我的问题很简单,如何从中选择? 最佳答案 好吧,一个,modules are much more powerful .例如,OCam
我是一名优秀的程序员,十分优秀!