File tree 8 files changed +55
-2
lines changed
8 files changed +55
-2
lines changed Original file line number Diff line number Diff line change @@ -12,7 +12,7 @@ function assertEqual(a, b) {
12
12
RE_EXN_ID : "Assert_failure" ,
13
13
_1 : [
14
14
"Stdlib.res" ,
15
- 118 ,
15
+ 119 ,
16
16
4
17
17
] ,
18
18
Error : new Error ( )
@@ -63,6 +63,8 @@ let Option;
63
63
64
64
let Ordering ;
65
65
66
+ let Pair ;
67
+
66
68
let $$Promise ;
67
69
68
70
let $$RegExp ;
@@ -138,6 +140,7 @@ export {
138
140
$$Object ,
139
141
Option ,
140
142
Ordering ,
143
+ Pair ,
141
144
$$Promise ,
142
145
$$RegExp ,
143
146
Result ,
Original file line number Diff line number Diff line change
1
+ /* This output is empty. Its source's type definitions, externals and/or unused code got optimized away. */
Original file line number Diff line number Diff line change @@ -12,7 +12,7 @@ function assertEqual(a, b) {
12
12
RE_EXN_ID : "Assert_failure" ,
13
13
_1 : [
14
14
"Stdlib.res" ,
15
- 118 ,
15
+ 119 ,
16
16
4
17
17
] ,
18
18
Error : new Error ( )
@@ -63,6 +63,8 @@ let Option;
63
63
64
64
let Ordering ;
65
65
66
+ let Pair ;
67
+
66
68
let $$Promise ;
67
69
68
70
let $$RegExp ;
@@ -137,6 +139,7 @@ exports.Nullable = Nullable;
137
139
exports . $$Object = $$Object ;
138
140
exports . Option = Option ;
139
141
exports . Ordering = Ordering ;
142
+ exports . Pair = Pair ;
140
143
exports . $$Promise = $$Promise ;
141
144
exports . $$RegExp = $$RegExp ;
142
145
exports . Result = Result ;
Original file line number Diff line number Diff line change
1
+ /* This output is empty. Its source's type definitions, externals and/or unused code got optimized away. */
Original file line number Diff line number Diff line change @@ -186,6 +186,7 @@ lib/es6/Stdlib_Nullable.js
186
186
lib/es6/Stdlib_Object.js
187
187
lib/es6/Stdlib_Option.js
188
188
lib/es6/Stdlib_Ordering.js
189
+ lib/es6/Stdlib_Pair.js
189
190
lib/es6/Stdlib_Promise.js
190
191
lib/es6/Stdlib_RegExp.js
191
192
lib/es6/Stdlib_Result.js
@@ -358,6 +359,7 @@ lib/js/Stdlib_Nullable.js
358
359
lib/js/Stdlib_Object.js
359
360
lib/js/Stdlib_Option.js
360
361
lib/js/Stdlib_Ordering.js
362
+ lib/js/Stdlib_Pair.js
361
363
lib/js/Stdlib_Promise.js
362
364
lib/js/Stdlib_RegExp.js
363
365
lib/js/Stdlib_Result.js
@@ -1151,6 +1153,10 @@ lib/ocaml/Stdlib_Ordering.cmi
1151
1153
lib/ocaml/Stdlib_Ordering.cmj
1152
1154
lib/ocaml/Stdlib_Ordering.cmt
1153
1155
lib/ocaml/Stdlib_Ordering.res
1156
+ lib/ocaml/Stdlib_Pair.cmi
1157
+ lib/ocaml/Stdlib_Pair.cmj
1158
+ lib/ocaml/Stdlib_Pair.cmt
1159
+ lib/ocaml/Stdlib_Pair.res
1154
1160
lib/ocaml/Stdlib_Promise.cmi
1155
1161
lib/ocaml/Stdlib_Promise.cmj
1156
1162
lib/ocaml/Stdlib_Promise.cmt
Original file line number Diff line number Diff line change @@ -283,7 +283,10 @@ external ignore: 'a => unit = "%ignore"
283
283
284
284
/* Pair operations */
285
285
286
+ @deprecated ("Use `Pair.first` instead. This will be removed in v13" )
286
287
external fst : (('a , 'b )) => 'a = "%field0"
288
+
289
+ @deprecated ("Use `Pair.second` instead. This will be removed in v13" )
287
290
external snd : (('a , 'b )) => 'b = "%field1"
288
291
289
292
/* References */
Original file line number Diff line number Diff line change @@ -20,6 +20,7 @@ module Nullable = Stdlib_Nullable
20
20
module Object = Stdlib_Object
21
21
module Option = Stdlib_Option
22
22
module Ordering = Stdlib_Ordering
23
+ module Pair = Stdlib_Pair
23
24
module Promise = Stdlib_Promise
24
25
module RegExp = Stdlib_RegExp
25
26
module Result = Stdlib_Result
Original file line number Diff line number Diff line change
1
+ /***
2
+ This module provides functions to work with pairs, which are 2-element tuples.
3
+ */
4
+
5
+ type t <'a , 'b > = ('a , 'b )
6
+
7
+ /**
8
+ `first(pair)` returns the first element of a pair.
9
+
10
+ ## Examples
11
+
12
+ ```rescript
13
+ Pair.first((1, 2))->assertEqual(1)
14
+ ```
15
+ */
16
+ external first : (('a , 'b )) => 'a = "%field0"
17
+
18
+ /**
19
+ `second(pair)` returns the second element of a pair.
20
+
21
+ ## Examples
22
+
23
+ ```rescript
24
+ Pair.second((1, 2))->assertEqual(2)
25
+ ```
26
+ */
27
+ external second : (('a , 'b )) => 'b = "%field1"
28
+
29
+ /**
30
+ `ignore(option)` ignores the provided pair and returns unit.
31
+
32
+ This helper is useful when you want to discard a value (for example, the result of an operation with side effects)
33
+ without having to store or process it further.
34
+ */
35
+ external ignore : ('a , 'b ) => unit = "%ignore"
You can’t perform that action at this time.
0 commit comments