I am trying to define a SCALAR
signature with its own infix operator in
module type SCALAR =sig type t (* type of scalar element *) val zero : t val one : t val (++) : t -> t -> t (* infix addition: t ++ t *)end
with using SCALAR
signature, I defined a INT
module:
module INT : SCALAR with type t = int=struct type t = int let zero = 0 let one = 1 let (++) x y = x + yend
I expected adding two INT
modules with defined infix operator like INT.zero ++ INT.one
is valid operation and expected its returning value int = 1
but it raises error of "Unbounded value ++".
However, INT.(++) INT.zero INT.one
worked correctly (with the return value I expected).
How can I use specific module's infix operator, without explicitly specifying module's name?