File tree 3 files changed +111
-0
lines changed
3 files changed +111
-0
lines changed Original file line number Diff line number Diff line change
1
+ // Generated by ReScript, PLEASE EDIT WITH CARE
2
+
3
+
4
+ function fromStringExn ( param ) {
5
+ switch ( param ) {
6
+ case "false" :
7
+ return false ;
8
+ case "true" :
9
+ return true ;
10
+ default :
11
+ throw {
12
+ RE_EXN_ID : "Invalid_argument" ,
13
+ _1 : "Bool.fromStringExn: value is neither \"true\" nor \"false\"" ,
14
+ Error : new Error ( )
15
+ } ;
16
+ }
17
+ }
18
+
19
+ function fromString ( param ) {
20
+ switch ( param ) {
21
+ case "false" :
22
+ return false ;
23
+ case "true" :
24
+ return true ;
25
+ default :
26
+ return ;
27
+ }
28
+ }
29
+
30
+ function xor ( a , b ) {
31
+ return a !== b ;
32
+ }
33
+
34
+ function xnor ( a , b ) {
35
+ return a === b ;
36
+ }
37
+
38
+ function nand ( a , b ) {
39
+ return ! ( a && b ) ;
40
+ }
41
+
42
+ function nor ( a , b ) {
43
+ return ! ( a || b ) ;
44
+ }
45
+
46
+ export {
47
+ fromStringExn ,
48
+ fromString ,
49
+ xnor ,
50
+ xor ,
51
+ nand ,
52
+ nor ,
53
+ }
54
+ /* No side effect */
Original file line number Diff line number Diff line change
1
+ // Core__Bool.res
2
+ external compare : (bool , bool ) => Core__Ordering .t = "%compare"
3
+
4
+ external equal : (bool , bool ) => bool = "%equal"
5
+
6
+ @send external toString : bool => string = "toString"
7
+
8
+ let fromStringExn = param =>
9
+ switch param {
10
+ | "true" => true
11
+ | "false" => false
12
+ | _ => raise (Invalid_argument (` Bool.fromStringExn: value is neither "true" nor "false"` ))
13
+ }
14
+
15
+ let fromString = param =>
16
+ switch param {
17
+ | "true" => Some (true )
18
+ | "false" => Some (false )
19
+ | _ => None
20
+ }
21
+
22
+ external and_ : (bool , bool ) => bool = "%sequand"
23
+
24
+ external or : (bool , bool ) => bool = "%sequor"
25
+
26
+ external not : bool => bool = "%boolnot"
27
+
28
+ let xor = (a , b ) => a !== b
29
+
30
+ let xnor = (a , b ) => ! xor (a , b )
31
+
32
+ let nand = (a , b ) => ! and_ (a , b )
33
+
34
+ let nor = (a , b ) => ! or (a , b )
Original file line number Diff line number Diff line change
1
+ external compare: (bool, bool) => Core__Ordering.t = "%compare"
2
+
3
+ external equal: (bool, bool) => bool = "%equal"
4
+
5
+ @send external toString: bool => string = "toString"
6
+
7
+ let fromStringExn: string => bool
8
+
9
+ let fromString: string => option<bool>
10
+
11
+ external and_: (bool, bool) => bool = "%sequand"
12
+
13
+ external or: (bool, bool) => bool = "%sequor"
14
+
15
+ external not: bool => bool = "%boolnot"
16
+
17
+ let xnor: (bool, bool) => bool
18
+
19
+ let xor: (bool, bool) => bool
20
+
21
+ let nand: (bool, bool) => bool
22
+
23
+ let nor: (bool, bool) => bool
You can’t perform that action at this time.
0 commit comments