Skip to content

Commit 5ba6007

Browse files
committed
fixup! Convert foreign modules to try bundling with esbuild
1 parent c0fcafb commit 5ba6007

File tree

2 files changed

+11
-14
lines changed

2 files changed

+11
-14
lines changed

src/Control/Monad/ST/Internal.js

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -26,17 +26,18 @@ export var run = function (f) {
2626
return f();
2727
};
2828

29-
export var while_ = function (f) {
29+
function whileST(f) {
3030
return function (a) {
3131
return function () {
3232
while (f()) {
3333
a();
3434
}
3535
};
3636
};
37-
};
37+
}
38+
export { whileST as while };
3839

39-
export var for_ = function (lo) {
40+
function forST(lo) {
4041
return function (hi) {
4142
return function (f) {
4243
return function () {
@@ -46,7 +47,8 @@ export var for_ = function (lo) {
4647
};
4748
};
4849
};
49-
};
50+
}
51+
export { forST as for }
5052

5153
export var foreach = function (as) {
5254
return function (f) {
@@ -58,11 +60,12 @@ export var foreach = function (as) {
5860
};
5961
};
6062

61-
export var new = function (val) {
63+
function newSTRef(val) {
6264
return function () {
6365
return { value: val };
6466
};
65-
};
67+
}
68+
export { newSTRef as new };
6669

6770
export var read = function (ref) {
6871
return function () {

src/Control/Monad/ST/Internal.purs

Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -86,19 +86,13 @@ foreign import run :: forall a. (forall r. ST r a) -> a
8686
-- | `while b m` is ST computation which runs the ST computation `b`. If its
8787
-- | result is `true`, it runs the ST computation `m` and loops. If not, the
8888
-- | computation ends.
89-
foreign import while_ :: forall r a. ST r Boolean -> ST r a -> ST r Unit
90-
91-
while :: forall r a. ST r Boolean -> ST r a -> ST r Unit
92-
while = while_
89+
foreign import while :: forall r a. ST r Boolean -> ST r a -> ST r Unit
9390

9491
-- | Loop over a consecutive collection of numbers
9592
-- |
9693
-- | `ST.for lo hi f` runs the computation returned by the function `f` for each
9794
-- | of the inputs between `lo` (inclusive) and `hi` (exclusive).
98-
foreign import for_ :: forall r a. Int -> Int -> (Int -> ST r a) -> ST r Unit
99-
100-
for :: forall r a. Int -> Int -> (Int -> ST r a) -> ST r Unit
101-
for = for_
95+
foreign import for :: forall r a. Int -> Int -> (Int -> ST r a) -> ST r Unit
10296

10397
-- | Loop over an array of values.
10498
-- |

0 commit comments

Comments
 (0)