Skip to content

Commit 6793a52

Browse files
committed
Get rid of Pervasives_mini
1 parent 6859e05 commit 6793a52

File tree

5 files changed

+21
-115
lines changed

5 files changed

+21
-115
lines changed

runtime/Pervasives.res

Lines changed: 14 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,7 @@
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
/**
217
Raises the given exception, terminating execution unless caught by a surrounding try/catch block.
@@ -36,6 +22,19 @@ assertEqual(result, "Caught exception: Out of milk")
3622
*/
3723
external 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

4140
@deprecated("This will be removed in v13")

runtime/Pervasives_mini.res

Lines changed: 0 additions & 93 deletions
This file was deleted.

runtime/Stdlib_Int.res

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -109,8 +109,8 @@ external shiftRightUnsigned: (int, int) => int = "%lsrint"
109109
external ignore: int => unit = "%ignore"
110110

111111
module Ref = {
112-
type t = Pervasives.ref<int>
112+
type t = ref<int>
113113

114-
external increment: t => unit = "%incr"
115-
external decrement: t => unit = "%decr"
114+
external increment: ref<int> => unit = "%incr"
115+
external decrement: ref<int> => unit = "%decr"
116116
}

runtime/Stdlib_Int.resi

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -484,7 +484,7 @@ external shiftRightUnsigned: (int, int) => int = "%lsrint"
484484
external ignore: int => unit = "%ignore"
485485

486486
module Ref: {
487-
type t = Pervasives.ref<int>
487+
type t = ref<int>
488488

489489
/**
490490
`increment(intRef)` increments the value of the provided reference by 1.
@@ -497,7 +497,7 @@ module Ref: {
497497
assertEqual(myRef.contents, 5)
498498
```
499499
*/
500-
external increment: t => unit = "%incr"
500+
external increment: ref<int> => unit = "%incr"
501501

502502
/**
503503
`decrement(intRef)` decrements the value of the provided reference by 1.
@@ -510,5 +510,5 @@ module Ref: {
510510
assertEqual(myRef.contents, 3)
511511
```
512512
*/
513-
external decrement: t => unit = "%decr"
513+
external decrement: ref<int> => unit = "%decr"
514514
}

runtime/rescript.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
"-make-runtime",
1010
"-nostdlib",
1111
"-nopervasives",
12-
"-open Pervasives_mini",
12+
"-open Pervasives",
1313
"-no-keep-locs",
1414
"-no-alias-deps",
1515
"-bs-no-version-header",

0 commit comments

Comments
 (0)