I have two modules A.ml
and B.ml
like so:
A.ml
:
type t = int
let from_int (i : int) : t = i
B.ml
:
open A
let my_t : t = from_int 0
I can compile them just fine by invoking ocamlc A.ml B.ml
however I have no idea how to load them both in utop
in order to use my_t
interactively. Using:
utop -init B.ml
yieldsError: Reference to undefined global 'A'
utop
followed by#use "A.ml";;
and#use "B.ml";;
leads to the same error- removing
open A
fromB.ml
makes this double#use
work butocamlc A.ml B.ml
now fails onB
withError: Unbound type constructor t
.