Cmdliner opam basic question

I have a question on both these code.

Sample 1


open Cmdliner

let revolt () = print_endline "Revolt!"

let revolt_t = Term.(const(revolt) $ const(()))

let () = Term.exit @@ Term.eval (revolt_t, Term.info "revolt")

Sample 2


open Cmdliner

let revolt () = print_endline "Revolt!"

let revolt_t = Term.(Term.const(revolt) $ Term.const(()))

let () = Term.exit @@ Term.eval (revolt_t, Term.info "revolt")

Both Sample 1 and Sample 2 compiles.

In Sample 2, i explicitly referenced Term.const(

I would like to know how this compiles.

let revolt_t = Term.(const(revolt) $ const(()))

How does Term.(const know to use the Term.const ?

The syntax ModuleName.(some_expression) is actually the same as let open ModuleName in expression, thus in Term.(const ...), when the compiler arrives at const it has imported all of the declarations from Term in the environment.

Thanks. Makes sense.