Skip to content

Commit b5ff62b

Browse files
committed
untagged variant for Json.t
1 parent 89a9d71 commit b5ff62b

File tree

2 files changed

+18
-2
lines changed

2 files changed

+18
-2
lines changed

jscomp/others/js_json.ml

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,15 @@
2424

2525
(** Efficient JSON encoding using JavaScript API *)
2626

27-
type t
27+
type t =
28+
| False [@as false]
29+
| True [@as true]
30+
| Null [@as null]
31+
| String of string
32+
| Number of float
33+
| Object of t Js.Dict.t
34+
| Array of t array
35+
[@@unboxed]
2836

2937
type _ kind =
3038
| String : Js_string.t kind

jscomp/others/js_json.mli

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,15 @@
3030

3131
(** ## Types *)
3232

33-
type t
33+
type t =
34+
| False [@as false]
35+
| True [@as true]
36+
| Null [@as null]
37+
| String of string
38+
| Number of float
39+
| Object of t Js.Dict.t
40+
| Array of t array
41+
[@@unboxed]
3442
(** The JSON data structure *)
3543

3644
(** Underlying type of a JSON value *)

0 commit comments

Comments
 (0)