diff --git a/compiler/catala.ml b/compiler/catala.ml index cf22a6e7..ecb541bf 100644 --- a/compiler/catala.ml +++ b/compiler/catala.ml @@ -14,4 +14,4 @@ License for the specific language governing permissions and limitations under the License. *) -let _ = Driver.main () +let () = Driver.main () diff --git a/compiler/catala_web_interpreter.ml b/compiler/catala_web_interpreter.ml index 7dcad020..baf74bc9 100644 --- a/compiler/catala_web_interpreter.ml +++ b/compiler/catala_web_interpreter.ml @@ -2,7 +2,7 @@ open Catala_utils open Driver open Js_of_ocaml -let _ = +let () = Js.export_all (object%js method interpret diff --git a/compiler/dcalc/invariants.ml b/compiler/dcalc/invariants.ml index 459497ac..4024f103 100644 --- a/compiler/dcalc/invariants.ml +++ b/compiler/dcalc/invariants.ml @@ -26,7 +26,6 @@ let check_invariant (inv : string * invariant_expr) (p : typed program) : bool = reference *) let result = ref true in let name, inv = inv in - let _ = name in let total = ref 0 in let ok = ref 0 in let p' = diff --git a/compiler/lcalc/to_ocaml.ml b/compiler/lcalc/to_ocaml.ml index a7bc61aa..ba8ba69d 100644 --- a/compiler/lcalc/to_ocaml.ml +++ b/compiler/lcalc/to_ocaml.ml @@ -630,7 +630,7 @@ let format_scope_exec for a main scope at the moment." scope_name_str; Format.pp_open_vbox fmt 2; - Format.pp_print_string fmt "let _ ="; + Format.pp_print_string fmt "let () ="; (* TODO: dump the output using yojson that should be already available from the runtime *) Format.pp_print_space fmt (); diff --git a/compiler/plugins/api_web.ml b/compiler/plugins/api_web.ml index 062ee90d..ba60af84 100644 --- a/compiler/plugins/api_web.ml +++ b/compiler/plugins/api_web.ml @@ -414,7 +414,7 @@ module To_jsoo = struct %a@\n\ %a@\n\ @\n\ - @[let _ =@ @[ Js.export \"%a\"@\n\ + @[let () =@ @[ Js.export \"%a\"@\n\ @[(object%%js@ %a@]@\n\ end)@]@]@?" (Option.fold ~none:"" ~some:(fun name -> name) module_name) diff --git a/compiler/shared_ast/definitions.ml b/compiler/shared_ast/definitions.ml index 5af08d69..78d0405a 100644 --- a/compiler/shared_ast/definitions.ml +++ b/compiler/shared_ast/definitions.ml @@ -604,7 +604,7 @@ type scope_let_kind = subscope variables. *) | CallingSubScope (** [let result = s ({ x = s.x; y = s.x; ...}) ]*) | DestructuringSubScopeResults (** [let s.x = result.x ]**) - | Assertion (** [let _ = assert e]*) + | Assertion (** [let () = assert e]*) type 'e scope_let = { scope_let_kind : scope_let_kind; diff --git a/compiler/shared_ast/optimizations.ml b/compiler/shared_ast/optimizations.ml index d1ee6a6a..bb7fca9c 100644 --- a/compiler/shared_ast/optimizations.ml +++ b/compiler/shared_ast/optimizations.ml @@ -228,7 +228,7 @@ let rec optimize_expr : (* at this point we know a conflict error will be triggered so we just feed the expression to the interpreter that will print the beautiful right error message *) - let _ = Interpreter.evaluate_expr ctx.decl_ctx e in + let (_ : _ gexpr) = Interpreter.evaluate_expr ctx.decl_ctx e in assert false else match excepts, just with diff --git a/compiler/tests.ml b/compiler/tests.ml index 5cbd7cc0..daabdbc6 100644 --- a/compiler/tests.ml +++ b/compiler/tests.ml @@ -1,4 +1,4 @@ -let _ = +let () = let open Alcotest in run "Optimizations" [ diff --git a/french_law/catala_legifrance/catala_legifrance.ml b/french_law/catala_legifrance/catala_legifrance.ml index af98f52b..25ad8635 100644 --- a/french_law/catala_legifrance/catala_legifrance.ml +++ b/french_law/catala_legifrance/catala_legifrance.ml @@ -298,7 +298,7 @@ let driver file debug diff expiration custom_date client_id client_secret = -1 (** Hook for the executable *) -let _ = +let () = Stdlib.exit @@ Cmdliner.Cmd.eval' ~catch:false (Cmdliner.Cmd.v Legifrance_cli.info diff --git a/french_law/ocaml/api_web.ml b/french_law/ocaml/api_web.ml index ec785c0d..653dd942 100644 --- a/french_law/ocaml/api_web.ml +++ b/french_law/ocaml/api_web.ml @@ -23,7 +23,7 @@ module AF_web = Allocations_familiales_api_web module AL = Aides_logement module AL_web = Aides_logement_api_web -let _ = +let () = Js.export_all (object%js val eventsManager = event_manager diff --git a/french_law/ocaml/bench.ml b/french_law/ocaml/bench.ml index 78d7ec6d..399570a1 100644 --- a/french_law/ocaml/bench.ml +++ b/french_law/ocaml/bench.ml @@ -228,19 +228,19 @@ let run_test_aides_logement () = | Runtime.AssertionFailed _ -> () let _test = - let _ = run_test_aides_logement () in + let () = run_test_aides_logement () in let raw_events = Runtime.retrieve_log () in Runtime.EventParser.parse_raw_events raw_events let _test = - let _ = run_test_allocations_familiales () in + let () = run_test_allocations_familiales () in let raw_events = Runtime.retrieve_log () in Runtime.EventParser.parse_raw_events raw_events let _bench = Random.init (int_of_float (Unix.time ())); let num_iter = 10000 in - let _ = + let (_ : Benchmark.samples) = Benchmark.latency1 ~style:Auto ~name:"Allocations familiales" (Int64.of_int num_iter) run_test_allocations_familiales () in @@ -254,7 +254,7 @@ let _bench = 100.) !total_amount (Float.div !total_amount (float_of_int !num_successful)); - let _ = + let (_ : Benchmark.samples) = Benchmark.latency1 ~style:Auto ~name:"Aides au logement" (Int64.of_int num_iter) run_test_aides_logement () in diff --git a/french_law/ocaml/law_source/unit_tests/run_tests.ml b/french_law/ocaml/law_source/unit_tests/run_tests.ml index 556a30a8..2c5995b4 100644 --- a/french_law/ocaml/law_source/unit_tests/run_tests.ml +++ b/french_law/ocaml/law_source/unit_tests/run_tests.ml @@ -8,7 +8,7 @@ let try_test msg test = failure := true; Format.printf "@{FAIL@} @{%s@}\n" msg -let _ = +let () = try_test "Allocations familiales #1" Tests_allocations_familiales.test1; try_test "Allocations familiales #2" Tests_allocations_familiales.test2; try_test "Allocations familiales #3" Tests_allocations_familiales.test3;