Я новичок в OCaml и пытаюсь попробовать (: P) синтаксис Facebook Reason. Я не могу найти способ сделать эту компиляцию, потому что если не могу найти модуль Core (уже установленный с opam).
Я пытаюсь скомпилировать пример программы из Real World OCaml
open Core.Std;
let rec read_and_accumulate accum => {
let line = In_channel.input_line In_channel.stdin;
switch line {
| None => accum
| Some x => read_and_accumulate (accum +. Float.of_string x)
}
};
let () = printf "Total: %F\n" (read_and_accumulate 0.);
Это команда, которую я использую для компиляции: rebuild accum.native
.
Когда у меня это есть в _tags
(из инструкций в https://janestreet.github.io/installation.html < / а>)
true: package(core,ppx_jane)
true: thread,debug
Моя ошибка изменилась, но я все еще не знаю, что делать:
File "_tags", line 1, characters 6-28:
Warning: tag "package" does not expect a parameter, but is used with parameter "core,ppx_jane"
File "_tags", line 1, characters 6-28:
Warning: the tag "package(core,ppx_jane)" is not used in any flag or dependency declaration, so it will have no effect; it may be a typo. Otherwise you can use `mark_tag_used` in your myocamlbuild.ml to disable this warning.
+ /Users/David/.opam/4.02.3/bin/ocamldep.opt -modules -pp refmt -impl accum2.re | tee accum2.re.depends accum2.ml.depends
accum2.re: Core Float In_channel
+ /Users/David/.opam/4.02.3/bin/ocamlc.opt -c -g -thread -pp '-g -thread' -pp refmt -o accum2.cmo -intf-suffix .rei -impl accum2.re
File "accum2.re", line 1, characters 5-13:
Error: Unbound module Core
Command exited with code 2.
Compilation unsuccessful after building 2 targets (0 cached) in 00:00:00.
Что мне нужно сделать, чтобы использовать Core с Reason?
Принять синтаксис довольно просто, я читал всего пару часов, но нет никаких документов о том, как использовать Reason для пользователей, не являющихся пользователями OCaml.