How to use Yaml_unix in dune project


I am trying to load a yaml file from disc in my dune/ocaml project.

I have added yaml in the dune file:

 (name mytool)
 (libraries core yaml))

Now, ocaml lsp recognizes the Yaml module and I can use it and compule via dune.

But when I do:

let  yaml_content = Yaml_unix.of_file_exn (Fpath.v "test.yaml")

I get form dune:

Error: Unbound module Yaml_unix

And FPath is also not recognized by my lsp.

I tried adding Yaml_unix in various ways to my project, but I not success.

Whay am I missing?

Thanks you!

Try using yaml.unix instead of yaml in your dune file.

1 Like

Its a . … thank you!