-
Notifications
You must be signed in to change notification settings - Fork 464
/
Copy pathVariantCoercion.js
110 lines (89 loc) · 1.58 KB
/
VariantCoercion.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
// Generated by ReScript, PLEASE EDIT WITH CARE
'use strict';
let x = {
kind: "One",
age: 1
};
let CoerceVariants = {
a: 1.1,
b: 1.1,
x: x,
y: x
};
let a = "hello";
let c = 100;
let CoerceWithPayload = {
a: a,
aa: "First",
b: a,
bb: "First",
c: c,
cc: 2,
d: c,
dd: 2
};
let a$1 = "hello";
let aa = "First";
let c$1 = "Hi";
let CoerceFromStringToVariant = {
a: a$1,
aa: aa,
b: a$1,
bb: aa,
c: c$1,
cc: c$1
};
let CoerceFromIntToVariant = {
a: 100,
aa: 1,
b: 100,
bb: 1,
c: 120,
cc: 120
};
let CoerceFromFloatToVariant = {
a: 100,
aa: 1,
b: 100,
bb: 1,
c: 120,
cc: 120
};
let CoerceFromBigintToVariant = {
a: 100n,
aa: 1n,
b: 100n,
bb: 1n,
c: 120n,
cc: 120n
};
let CoerceFromPolyvariantToVariant = {
simple: "One",
simpleP: "One",
withAs: "One",
withAsP: "One",
withMoreVariantConstructors: "One",
withMoreVariantConstructorsP: "One",
withUnboxedCatchAll: "One",
withUnboxedCatchAllP: "One"
};
let a$2 = "Three";
let b = "Three";
let i = 1;
let d = 1;
let ii = 1.1;
let dd = 1.1;
exports.a = a$2;
exports.b = b;
exports.i = i;
exports.d = d;
exports.ii = ii;
exports.dd = dd;
exports.CoerceVariants = CoerceVariants;
exports.CoerceWithPayload = CoerceWithPayload;
exports.CoerceFromStringToVariant = CoerceFromStringToVariant;
exports.CoerceFromIntToVariant = CoerceFromIntToVariant;
exports.CoerceFromFloatToVariant = CoerceFromFloatToVariant;
exports.CoerceFromBigintToVariant = CoerceFromBigintToVariant;
exports.CoerceFromPolyvariantToVariant = CoerceFromPolyvariantToVariant;
/* No side effect */