|
406 | 406 | let rec sum_to_json =
|
407 | 407 | (fun x ->
|
408 | 408 | match x with
|
409 |
| - | A -> (Obj.magic [| string_to_json "A" |] : Js.Json.t) |
| 409 | + | A -> (Obj.magic [| (Obj.magic "A" : Js.Json.t) |] : Js.Json.t) |
410 | 410 | | B x_0 ->
|
411 |
| - (Obj.magic [| string_to_json "B"; int_to_json x_0 |] |
| 411 | + (Obj.magic [| (Obj.magic "B" : Js.Json.t); int_to_json x_0 |] |
412 | 412 | : Js.Json.t)
|
413 | 413 | | C { name = x_name } ->
|
414 | 414 | (Obj.magic
|
415 | 415 | [|
|
416 |
| - string_to_json "C"; |
| 416 | + (Obj.magic "C" : Js.Json.t); |
417 | 417 | (Obj.magic [%mel.obj { name = string_to_json x_name }]
|
418 | 418 | : Js.Json.t);
|
419 | 419 | |]
|
|
472 | 472 | | S2 (x_0, x_1) ->
|
473 | 473 | (Obj.magic
|
474 | 474 | [|
|
475 |
| - string_to_json "S2"; int_to_json x_0; string_to_json x_1; |
| 475 | + (Obj.magic "S2" : Js.Json.t); |
| 476 | + int_to_json x_0; |
| 477 | + string_to_json x_1; |
476 | 478 | |]
|
477 | 479 | : Js.Json.t)
|
478 | 480 | : sum2 -> Js.Json.t)
|
|
532 | 534 | let rec other_to_json =
|
533 | 535 | (fun x ->
|
534 | 536 | match x with
|
535 |
| - | `C -> (Obj.magic [| string_to_json "C" |] : Js.Json.t) |
| 537 | + | `C -> (Obj.magic [| (Obj.magic "C" : Js.Json.t) |] : Js.Json.t) |
536 | 538 | : other -> Js.Json.t)
|
537 | 539 |
|
538 | 540 | let _ = other_to_json
|
|
595 | 597 | let rec poly_to_json =
|
596 | 598 | (fun x ->
|
597 | 599 | match x with
|
598 |
| - | `A -> (Obj.magic [| string_to_json "A" |] : Js.Json.t) |
| 600 | + | `A -> (Obj.magic [| (Obj.magic "A" : Js.Json.t) |] : Js.Json.t) |
599 | 601 | | `B x_0 ->
|
600 |
| - (Obj.magic [| string_to_json "B"; int_to_json x_0 |] |
| 602 | + (Obj.magic [| (Obj.magic "B" : Js.Json.t); int_to_json x_0 |] |
601 | 603 | : Js.Json.t)
|
602 | 604 | | #other as x -> other_to_json x
|
603 | 605 | : poly -> Js.Json.t)
|
|
663 | 665 | | `P2 (x_0, x_1) ->
|
664 | 666 | (Obj.magic
|
665 | 667 | [|
|
666 |
| - string_to_json "P2"; int_to_json x_0; string_to_json x_1; |
| 668 | + (Obj.magic "P2" : Js.Json.t); |
| 669 | + int_to_json x_0; |
| 670 | + string_to_json x_1; |
667 | 671 | |]
|
668 | 672 | : Js.Json.t)
|
669 | 673 | : poly2 -> Js.Json.t)
|
|
721 | 725 | fun x ->
|
722 | 726 | match x with
|
723 | 727 | | `C x_0 ->
|
724 |
| - (Obj.magic [| string_to_json "C"; a_to_json x_0 |] : Js.Json.t) |
| 728 | + (Obj.magic [| (Obj.magic "C" : Js.Json.t); a_to_json x_0 |] |
| 729 | + : Js.Json.t) |
725 | 730 |
|
726 | 731 | let _ = c_to_json
|
727 | 732 | end [@@ocaml.doc "@inline"] [@@merlin.hide]
|
|
775 | 780 | let rec recur_to_json =
|
776 | 781 | (fun x ->
|
777 | 782 | match x with
|
778 |
| - | A -> (Obj.magic [| string_to_json "A" |] : Js.Json.t) |
| 783 | + | A -> (Obj.magic [| (Obj.magic "A" : Js.Json.t) |] : Js.Json.t) |
779 | 784 | | Fix x_0 ->
|
780 |
| - (Obj.magic [| string_to_json "Fix"; recur_to_json x_0 |] |
| 785 | + (Obj.magic |
| 786 | + [| (Obj.magic "Fix" : Js.Json.t); recur_to_json x_0 |] |
781 | 787 | : Js.Json.t)
|
782 | 788 | : recur -> Js.Json.t)
|
783 | 789 |
|
|
842 | 848 | let rec polyrecur_to_json =
|
843 | 849 | (fun x ->
|
844 | 850 | match x with
|
845 |
| - | `A -> (Obj.magic [| string_to_json "A" |] : Js.Json.t) |
| 851 | + | `A -> (Obj.magic [| (Obj.magic "A" : Js.Json.t) |] : Js.Json.t) |
846 | 852 | | `Fix x_0 ->
|
847 |
| - (Obj.magic [| string_to_json "Fix"; polyrecur_to_json x_0 |] |
| 853 | + (Obj.magic |
| 854 | + [| (Obj.magic "Fix" : Js.Json.t); polyrecur_to_json x_0 |] |
848 | 855 | : Js.Json.t)
|
849 | 856 | : polyrecur -> Js.Json.t)
|
850 | 857 |
|
|
900 | 907 | let rec evar_to_json =
|
901 | 908 | (fun x ->
|
902 | 909 | match x with
|
903 |
| - | A -> (Obj.magic [| string_to_json "A" |] : Js.Json.t) |
904 |
| - | B -> (Obj.magic [| string_to_json "b_aliased" |] : Js.Json.t) |
| 910 | + | A -> (Obj.magic [| (Obj.magic "A" : Js.Json.t) |] : Js.Json.t) |
| 911 | + | B -> |
| 912 | + (Obj.magic [| (Obj.magic "b_aliased" : Js.Json.t) |] |
| 913 | + : Js.Json.t) |
905 | 914 | : evar -> Js.Json.t)
|
906 | 915 |
|
907 | 916 | let _ = evar_to_json
|
|
964 | 973 | let rec epoly_to_json =
|
965 | 974 | (fun x ->
|
966 | 975 | match x with
|
967 |
| - | `a -> (Obj.magic [| string_to_json "A_aliased" |] : Js.Json.t) |
968 |
| - | `b -> (Obj.magic [| string_to_json "b" |] : Js.Json.t) |
| 976 | + | `a -> |
| 977 | + (Obj.magic [| (Obj.magic "A_aliased" : Js.Json.t) |] |
| 978 | + : Js.Json.t) |
| 979 | + | `b -> (Obj.magic [| (Obj.magic "b" : Js.Json.t) |] : Js.Json.t) |
969 | 980 | : epoly -> Js.Json.t)
|
970 | 981 |
|
971 | 982 | let _ = epoly_to_json
|
|
1019 | 1030 | fun x ->
|
1020 | 1031 | match x with
|
1021 | 1032 | | A x_0 ->
|
1022 |
| - (Obj.magic [| string_to_json "A"; a_to_json x_0 |] : Js.Json.t) |
| 1033 | + (Obj.magic [| (Obj.magic "A" : Js.Json.t); a_to_json x_0 |] |
| 1034 | + : Js.Json.t) |
1023 | 1035 | | B x_0 ->
|
1024 |
| - (Obj.magic [| string_to_json "B"; b_to_json x_0 |] : Js.Json.t) |
| 1036 | + (Obj.magic [| (Obj.magic "B" : Js.Json.t); b_to_json x_0 |] |
| 1037 | + : Js.Json.t) |
1025 | 1038 |
|
1026 | 1039 | let _ = p2_to_json
|
1027 | 1040 | end [@@ocaml.doc "@inline"] [@@merlin.hide]
|
|
1147 | 1160 | | A { a = x_a } ->
|
1148 | 1161 | (Obj.magic
|
1149 | 1162 | [|
|
1150 |
| - string_to_json "A"; |
| 1163 | + (Obj.magic "A" : Js.Json.t); |
1151 | 1164 | (Obj.magic [%mel.obj { a = int_to_json x_a }] : Js.Json.t);
|
1152 | 1165 | |]
|
1153 | 1166 | : Js.Json.t)
|
|
0 commit comments