我正在尝试使用Jane Street的核心标准库和原因语言前端进行编程。
因此,我采用了corebuild脚本,并通过将ocamlbuild替换为rebuild,将副本保存为recorebuild。但我有一些简单的代码有困难。
这是失败的最小示例:
type t = Foo int | Bar;
let foobar f => switch f {
| Foo x => x
| Bar => 0
};如果您尝试使用以下选项编译它,则corebuild添加的众多选项之一
rebuild -tag "ppx(ppx-jane -as-ppx)" test.byte然后得到这个错误:
File "", line 0:
Attribute `explicit_arity' was not used
Command exited with code 2.什么意思?
发布于 2017-09-20 22:42:26
explicit_arity是refmt发出的一个属性,用于解决OCaml语法中有关变体的歧义。不幸的是,它与Jane St冲突,但是如果您从-tag "ppx(ppx-jane -as-ppx)"脚本中删除corebuild,它应该能工作。
(注意:这些信息来自于不和谐的原因,我个人对此没有任何经验)
https://stackoverflow.com/questions/46332678
复制相似问题