2

I'm trying to program using Jane Street's Core standard library and the Reason language frontend.

So I took the corebuild script and saved a copy as recorebuild by replacing ocamlbuild with rebuild. But I'm having trouble with some simple code.

This is the minimal example that fails:

type t = Foo int | Bar;

let foobar f => switch f {
| Foo x => x
| Bar => 0
};

If you try to compile it with the following option, one of the many added by corebuild:

rebuild -tag "ppx(ppx-jane -as-ppx)" test.byte

then you get this error:

File "", line 0:
Attribute `explicit_arity' was not used
Command exited with code 2.

What does it mean?

Tobia
  • 17,856
  • 6
  • 74
  • 93
  • I'm interested in using Jane Street's Core in Reason too. Do you know of a doc/tutorial/blog explaining how to do that? – hendysg Nov 17 '17 at 03:24

1 Answers1

1

explicit_arity is an attribute emitted by refmt to resolve an ambiguity in the OCaml syntax regarding variants. Unfortunately it conflicts with a Jane St ppx, but it should work if you remove -tag "ppx(ppx-jane -as-ppx)" from the corebuild script.

(Note: This information is taken from the Reason Discord, I don't personally have any experience with this)

glennsl
  • 28,186
  • 12
  • 57
  • 75
  • Can you link to the place that mentions it? Google didn't turn out much at all. – Tobia Sep 20 '17 at 23:29
  • I don't have any links I'm afraid. But if you hop on the Reason Discord, https://discord.gg/reasonml (no registration required), you can search for it. – glennsl Sep 20 '17 at 23:55
  • Actually, I think this is the issue that introduced it. Has a lot of discussion though: https://github.com/facebook/reason/issues/63 – glennsl Sep 20 '17 at 23:59