I created a module like this:
module Foo =
struct
class foo =
object(this)
...
end
let (><) (f1:foo) (f2:foo) = ...
end
After that I opened this module in a different file and tried to use operator ><, but ocamlc threw an error: "Error: Unbound value ><", but in utop this operator works right.
open Foo
let x = new Foo.foo;;
let y = new Foo.foo;;
let z = x >< y;;
Maybe this problem connected with options to ocamlc, I compiled like this
ocamlfind ocamlc -linkpkg -thread -package core Foo.ml test.ml -o main
where Foo.ml is a file with module Foo, test.ml contains usage of operator.
So, does OCaml support this way of using operators or I made something wrong?