Skip to content

Commit 1313bb8

Browse files
authored
Prettify predef registration (#7124)
1 parent 3f031d4 commit 1313bb8

File tree

1 file changed

+30
-47
lines changed

1 file changed

+30
-47
lines changed

compiler/ml/predef.ml

Lines changed: 30 additions & 47 deletions
Original file line numberDiff line numberDiff line change
@@ -388,53 +388,36 @@ let common_initial_env add_type add_extension empty_env =
388388
ext_is_exception = true;
389389
}
390390
in
391-
add_exception ident_match_failure
392-
[newgenty (Ttuple [type_string; type_int; type_int])]
393-
(add_exception ident_invalid_argument [type_string]
394-
(add_exception ident_js_error [type_unknown]
395-
(add_exception ident_failure [type_string]
396-
(add_exception ident_not_found []
397-
(add_exception ident_end_of_file []
398-
(add_exception ident_division_by_zero []
399-
(add_exception ident_assert_failure
400-
[newgenty (Ttuple [type_string; type_int; type_int])]
401-
(add_exception ident_undefined_recursive_module
402-
[
403-
newgenty (Ttuple [type_string; type_int; type_int]);
404-
]
405-
(add_type ident_bigint decl_abstr
406-
(add_type ident_lazy_t decl_lazy_t
407-
(add_type ident_option decl_option
408-
(add_type ident_result decl_result
409-
(add_type ident_dict decl_dict
410-
(add_type ident_list decl_list
411-
(add_type ident_array decl_array
412-
(add_type ident_exn decl_exn
413-
(add_type ident_unit
414-
decl_unit
415-
(add_type ident_bool
416-
decl_bool
417-
(add_type ident_float
418-
decl_abstr
419-
(add_type
420-
ident_unknown
421-
decl_unknown
422-
(add_type
423-
ident_uncurried
424-
decl_uncurried
425-
(add_type
426-
ident_string
427-
decl_abstr
428-
(add_type
429-
ident_int
430-
decl_abstr_imm
431-
(add_type
432-
ident_extension_constructor
433-
decl_abstr
434-
(add_type
435-
ident_promise
436-
decl_promise
437-
empty_env)))))))))))))))))))))))))
391+
empty_env
392+
|> add_type ident_bool decl_bool
393+
|> add_type ident_int decl_abstr_imm
394+
|> add_type ident_float decl_abstr
395+
|> add_type ident_bigint decl_abstr
396+
|> add_type ident_string decl_abstr
397+
|> add_type ident_unit decl_unit
398+
|> add_type ident_extension_constructor decl_abstr
399+
|> add_type ident_exn decl_exn
400+
|> add_type ident_uncurried decl_uncurried
401+
|> add_type ident_option decl_option
402+
|> add_type ident_result decl_result
403+
|> add_type ident_lazy_t decl_lazy_t
404+
|> add_type ident_promise decl_promise
405+
|> add_type ident_array decl_array
406+
|> add_type ident_list decl_list
407+
|> add_type ident_dict decl_dict
408+
|> add_type ident_unknown decl_unknown
409+
|> add_exception ident_undefined_recursive_module
410+
[newgenty (Ttuple [type_string; type_int; type_int])]
411+
|> add_exception ident_assert_failure
412+
[newgenty (Ttuple [type_string; type_int; type_int])]
413+
|> add_exception ident_division_by_zero []
414+
|> add_exception ident_end_of_file []
415+
|> add_exception ident_not_found []
416+
|> add_exception ident_failure [type_string]
417+
|> add_exception ident_js_error [type_unknown]
418+
|> add_exception ident_invalid_argument [type_string]
419+
|> add_exception ident_match_failure
420+
[newgenty (Ttuple [type_string; type_int; type_int])]
438421

439422
let build_initial_env add_type add_exception empty_env =
440423
let common = common_initial_env add_type add_exception empty_env in

0 commit comments

Comments
 (0)