Skip to content

Commit 7a8880b

Browse files
committed
type s instead kind
1 parent 68e6506 commit 7a8880b

File tree

3 files changed

+17
-17
lines changed

3 files changed

+17
-17
lines changed

jscomp/others/js_json.res

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -35,13 +35,13 @@ type rec t =
3535
| Array(array<t>)
3636

3737
module Kind = {
38-
type rec kind<_> =
39-
| String: kind<Js_string.t>
40-
| Number: kind<float>
41-
| Object: kind<Js_dict.t<t>>
42-
| Array: kind<array<t>>
43-
| Boolean: kind<bool>
44-
| Null: kind<Js_types.null_val>
38+
type rec s<_> =
39+
| String: s<Js_string.t>
40+
| Number: s<float>
41+
| Object: s<Js_dict.t<t>>
42+
| Array: s<array<t>>
43+
| Boolean: s<bool>
44+
| Null: s<Js_types.null_val>
4545
}
4646

4747
type tagged_t =
@@ -74,7 +74,7 @@ let classify = (x: t): tagged_t => {
7474
}
7575
}
7676

77-
let test = (type a, x: 'a, v: Kind.kind<a>): bool =>
77+
let test = (type a, x: 'a, v: Kind.s<a>): bool =>
7878
switch v {
7979
| Kind.Number => Js.typeof(x) == "number"
8080
| Kind.Boolean => Js.typeof(x) == "boolean"

jscomp/others/js_json.resi

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -42,13 +42,13 @@ type rec t =
4242

4343
module Kind: {
4444
/** Underlying type of a JSON value */
45-
type rec kind<_> =
46-
| String: kind<Js_string.t>
47-
| Number: kind<float>
48-
| Object: kind<Js_dict.t<t>>
49-
| Array: kind<array<t>>
50-
| Boolean: kind<bool>
51-
| Null: kind<Js_types.null_val>
45+
type rec s<_> =
46+
| String: s<Js_string.t>
47+
| Number: s<float>
48+
| Object: s<Js_dict.t<t>>
49+
| Array: s<array<t>>
50+
| Boolean: s<bool>
51+
| Null: s<Js_types.null_val>
5252
}
5353

5454
type tagged_t =
@@ -65,7 +65,7 @@ type tagged_t =
6565
let classify: t => tagged_t
6666

6767
/** `test(v, kind)` returns `true` if `v` is of `kind`. */
68-
let test: ('a, Kind.kind<'b>) => bool
68+
let test: ('a, Kind.s<'b>) => bool
6969

7070
/** `decodeString(json)` returns `Some(s)` if `json` is a `string`, `None` otherwise. */
7171
let decodeString: t => option<Js_string.t>

jscomp/test/js_json_test.res

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -145,7 +145,7 @@ let () = {
145145

146146
/* Check that the given json value is an array and that its element
147147
* a position [i] is equal to both the [kind] and [expected] value */
148-
let eq_at_i = (type a, loc: string, json: J.t, i: int, kind: J.Kind.kind<a>, expected: a): unit => {
148+
let eq_at_i = (type a, loc: string, json: J.t, i: int, kind: J.Kind.s<a>, expected: a): unit => {
149149
let ty = J.classify(json)
150150
switch ty {
151151
| J.JSONArray(x) =>

0 commit comments

Comments
 (0)