Hi there,
I’m quite new to OCaml and I’m rooting for https://preview.dune.build/
Knowing very little about anything really I cannot figure out how to install and actual dependency.
I think I’m looking for the npm install foo
equivalent in the new dune world.
I created a project using dune init project my_name
.
And now I’d like to play around with ppx_deriving
.
Their GitHub says opam install ppx_deriving
, so I thought dune install ppx_deriving
would do the trick but nothing happens:
Error: Unknown package ppx_deriving!
I also updated my bin/main.ml
to
type coord = { x : int; y : int }
let () = print_endline "Hello, World!"
This now does not compile:
dune build
:
File "bin/main.ml", line 1, characters 0-33:
1 | type coord = { x : int; y : int }
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
Error (warning 34 [unused-type-declaration]): unused type coord.
File "bin/main.ml", line 1, characters 15-23:
1 | type coord = { x : int; y : int }
^^^^^^^^
Error (warning 69 [unused-field]): unused record field x.
File "bin/main.ml", line 1, characters 24-31:
1 | type coord = { x : int; y : int }
^^^^^^^
Error (warning 69 [unused-field]): unused record field y.
This is all rather strict, can I treat this warning as a warning?
Lastly, what do I tell the ocaml vscode extension:
The current Merlin configuration has been generated by another, incompatible, version of Dune. Please rebuild the project. (Using the same version of Dune as the one running the 'ocaml-merlin' server.)ocamllsp
Does anyone have any pointers?
Cheers!
1 post - 1 participant