11@deprecated ("Do not use. This will be removed in v13" )
2- external /* Internal */
3-
4- __unsafe_cast : 'a => 'b = "%identity"
2+ external __unsafe_cast : 'a => 'b = "%identity"
53
64/* Exceptions */
7- @deprecated (
8- "`raise` has been renamed to `throw` to align with JavaScript vocabulary. Please use `throw` instead"
9- )
10- external raise : exn => 'a = "%raise"
11-
12- @deprecated ("Use custom exception instead" )
13- let failwith = s => throw (Failure (s ))
14-
15- @deprecated ("Use custom exception instead" )
16- let invalid_arg = s => throw (Invalid_argument (s ))
17-
18- @deprecated ("Use custom exception instead" ) exception Exit
195
206/**
217Raises the given exception, terminating execution unless caught by a surrounding try/catch block.
@@ -36,9 +22,25 @@ assertEqual(result, "Caught exception: Out of milk")
3622*/
3723external throw : exn => 'a = "%raise"
3824
25+ @deprecated (
26+ "`raise` has been renamed to `throw` to align with JavaScript vocabulary. Please use `throw` instead"
27+ )
28+ external raise : exn => 'a = "%raise"
29+
30+ @deprecated ("Use custom exception instead" )
31+ let failwith = s => throw (Failure (s ))
32+
33+ @deprecated ("Use custom exception instead" )
34+ let invalid_arg = s => throw (Invalid_argument (s ))
35+
36+ @deprecated ("Use custom exception instead" ) exception Exit
37+
3938/* Composition operators */
4039
40+ @deprecated ("This will be removed in v13" )
4141external \"|>" : ('a , 'a => 'b ) => 'b = "%revapply"
42+
43+ @deprecated ("This will be removed in v13" )
4244external \"@@" : ('a => 'b , 'a ) => 'b = "%apply"
4345
4446/* Debugging */
@@ -92,7 +94,10 @@ external \"||": (bool, bool) => bool = "%sequor"
9294
9395/* Integer operations */
9496
97+ @deprecated ("Use `x => x + 1` instead. This will be removed in v13" )
9598external succ : int => int = "%succint"
99+
100+ @deprecated ("Use `x => x - 1` instead. This will be removed in v13" )
96101external pred : int => int = "%predint"
97102
98103@deprecated ("Use `Math.abs` instead. This will be removed in v13" )
@@ -103,14 +108,25 @@ let abs = x =>
103108 - x
104109 }
105110
111+ @deprecated ("Use `Int.bitwiseAnd` instead. This will be removed in v13" )
106112external land : (int , int ) => int = "%andint"
113+
114+ @deprecated ("Use `Int.bitwiseOr` instead. This will be removed in v13" )
107115external lor : (int , int ) => int = "%orint"
116+
117+ @deprecated ("Use `Int.bitwiseXor` instead. This will be removed in v13" )
108118external lxor : (int , int ) => int = "%xorint"
109119
120+ @deprecated ("Use `Int.bitwiseNot` instead. This will be removed in v13" )
110121let lnot = x => lxor (x , - 1 )
111122
123+ @deprecated ("Use `Int.shiftLeft` instead. This will be removed in v13" )
112124external lsl : (int , int ) => int = "%lslint"
125+
126+ @deprecated ("Use `Int.shiftRightUnsigned` instead. This will be removed in v13" )
113127external lsr : (int , int ) => int = "%lsrint"
128+
129+ @deprecated ("Use `Int.shiftRight` instead. This will be removed in v13" )
114130external asr : (int , int ) => int = "%asrint"
115131
116132@deprecated ("Use `Int.Constants.maxValue` instead. This will be removed in v13" )
@@ -266,16 +282,25 @@ external ignore: 'a => unit = "%ignore"
266282
267283/* Pair operations */
268284
285+ @deprecated ("Use `Pair.first` instead. This will be removed in v13" )
269286external fst : (('a , 'b )) => 'a = "%field0"
287+
288+ @deprecated ("Use `Pair.second` instead. This will be removed in v13" )
270289external snd : (('a , 'b )) => 'b = "%field1"
271290
272291/* References */
273292
274293type ref <'a > = {mutable contents : 'a }
275294external ref : 'a => ref <'a > = "%makeref"
276- external \"!" : ref <'a > => 'a = "%refget"
277295external \":=" : (ref <'a >, 'a ) => unit = "%refset"
296+
297+ @deprecated ("Do not use. This will be removed in v13" )
298+ external \"!" : ref <'a > => 'a = "%refget"
299+
300+ @deprecated ("Use `Int.Ref.increment` instead. This will be removed in v13" )
278301external incr : ref <int > => unit = "%incr"
302+
303+ @deprecated ("Use `Int.Ref.decrement` instead. This will be removed in v13" )
279304external decr : ref <int > => unit = "%decr"
280305
281306/* String conversion functions */
@@ -310,6 +335,7 @@ external string_of_int: int => string = "String"
310335@deprecated ("Use `Int.fromString` instead. This will be removed in v13" ) @scope ("Number" )
311336external int_of_string : string => int = "parseInt"
312337
338+ @deprecated ("Use `Int.fromString` instead. This will be removed in v13" )
313339let int_of_string_opt = s =>
314340 switch int_of_string (s ) {
315341 | n if n == %raw ("NaN" ) => None
@@ -330,4 +356,5 @@ let rec \"@" = (l1, l2) =>
330356
331357/* Miscellaneous */
332358
359+ @deprecated ("This will be removed in v13" )
333360type int32 = int
0 commit comments