I tried to compile an OCaml code with Dune but got the following error: Error: No implementations provided for the following modules:
CallccBp referenced from bin/.CallccTest.eobjs/native/dune__exe__CallccTest.cmx
by executing the command : $ dune build
My project hierarchy is as follows:
How can I solve this problem?
What is the content of
callccBp.mli? Does it define any exception?
type 'a cont
val callcc: ('a cont → 'a) → 'a
val throw: 'a cont → 'a → 'b
let now () =
let s = ref None in
callcc (fun k → s := Some k);
let past_travel_to date =
match !date with
| None → assert false
| Some date → throw date ()
let cake = ref
Cake let eat () = assert (!cake = Cake);
Printf.printf “I am eating the cake! Miamee!\n”;
cake := `NoMoreCake
let _ =
let t = now () in
Printf.printf “I am in front of the cake\n.”;
CallccBp declares values
throw, so it needs an implementation: you cannot use
modules_without_implementation for such modules. You must provide an implementation.
Without the deposit
I have the following error: File “lib/dune”, line 1, characters 0-26:
1 | (library
2 | (name CallccBp))
Error: Some modules don’t have an implementation.
You need to add the following field to this stanza:
You need to write down a
type 'a cont = ...
let callcc = ...
let throw = ...
What is the general context? It is a bit surprising that you ended up writing a library without knowing what are mli fles.
When I first tried the program it gave me the signature error and I didn’t know there was another solution.
type 'a cont
let callcc = ('a cont → 'a) → 'a
let throw = 'a cont → 'a → 'b
I have error :
File “bin/CallCCTest.ml”, line 2, characters 14-15:
2 | let callcc = ('a cont → 'a) → 'a
Error: Syntax error: operator expected.
This is not valid OCaml code: a type is not an implementation.
At this point, it is probably better to try to take some distance and take the time to contextualize what you are trying to do.
Thank you for your help.
I tried to transfer the code from Ocaml to Coq, I found the coq-of-ocaml tool. for this the code must be compiled with dune.