Can you use code blocks to format the code so that it’s easier to read?
It sounds like this is the contents of your UtilsM.ml file:
module type UtilsMType = sig
val pi' : float
...
end
module UtilsM : UtilsMType = struct
...
end
Is that correct? If so, the “fully-qualified” module path to the value is UtilsM.UtilsM.pi', not UtilsM.pi'. That might explain why the second open was necessary.
Since you mentioned macOS, it’s possible that the case-insensitive filesystem made a difference here, but I don’t have a good idea of how exactly that happened. What happens if you name the file utilsM.ml instead of UtilsM.ml?