Skip to content

Commit c0fcafb

Browse files
committed
Convert foreign modules to try bundling with esbuild
1 parent 994eb5e commit c0fcafb

File tree

2 files changed

+19
-13
lines changed

2 files changed

+19
-13
lines changed

src/Control/Monad/ST/Internal.js

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,32 +1,32 @@
11
"use strict";
22

3-
exports.map_ = function (f) {
3+
export var map_ = function (f) {
44
return function (a) {
55
return function () {
66
return f(a());
77
};
88
};
99
};
1010

11-
exports.pure_ = function (a) {
11+
export var pure_ = function (a) {
1212
return function () {
1313
return a;
1414
};
1515
};
1616

17-
exports.bind_ = function (a) {
17+
export var bind_ = function (a) {
1818
return function (f) {
1919
return function () {
2020
return f(a())();
2121
};
2222
};
2323
};
2424

25-
exports.run = function (f) {
25+
export var run = function (f) {
2626
return f();
2727
};
2828

29-
exports["while"] = function (f) {
29+
export var while_ = function (f) {
3030
return function (a) {
3131
return function () {
3232
while (f()) {
@@ -36,7 +36,7 @@ exports["while"] = function (f) {
3636
};
3737
};
3838

39-
exports["for"] = function (lo) {
39+
export var for_ = function (lo) {
4040
return function (hi) {
4141
return function (f) {
4242
return function () {
@@ -48,7 +48,7 @@ exports["for"] = function (lo) {
4848
};
4949
};
5050

51-
exports.foreach = function (as) {
51+
export var foreach = function (as) {
5252
return function (f) {
5353
return function () {
5454
for (var i = 0, l = as.length; i < l; i++) {
@@ -58,19 +58,19 @@ exports.foreach = function (as) {
5858
};
5959
};
6060

61-
exports.new = function (val) {
61+
export var new = function (val) {
6262
return function () {
6363
return { value: val };
6464
};
6565
};
6666

67-
exports.read = function (ref) {
67+
export var read = function (ref) {
6868
return function () {
6969
return ref.value;
7070
};
7171
};
7272

73-
exports.modifyImpl = function (f) {
73+
export var modifyImpl = function (f) {
7474
return function (ref) {
7575
return function () {
7676
var t = f(ref.value);
@@ -80,7 +80,7 @@ exports.modifyImpl = function (f) {
8080
};
8181
};
8282

83-
exports.write = function (a) {
83+
export var write = function (a) {
8484
return function (ref) {
8585
return function () {
8686
return ref.value = a; // eslint-disable-line no-return-assign

src/Control/Monad/ST/Internal.purs

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -86,13 +86,19 @@ 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
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_
9093

9194
-- | Loop over a consecutive collection of numbers
9295
-- |
9396
-- | `ST.for lo hi f` runs the computation returned by the function `f` for each
9497
-- | of the inputs between `lo` (inclusive) and `hi` (exclusive).
95-
foreign import for :: forall r a. Int -> Int -> (Int -> ST r a) -> ST r Unit
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_
96102

97103
-- | Loop over an array of values.
98104
-- |

0 commit comments

Comments
 (0)