File tree Expand file tree Collapse file tree 2 files changed +11
-14
lines changed Expand file tree Collapse file tree 2 files changed +11
-14
lines changed Original file line number Diff line number Diff line change @@ -26,17 +26,18 @@ export var run = function (f) {
26
26
return f ( ) ;
27
27
} ;
28
28
29
- export var while_ = function ( f ) {
29
+ function whileST ( f ) {
30
30
return function ( a ) {
31
31
return function ( ) {
32
32
while ( f ( ) ) {
33
33
a ( ) ;
34
34
}
35
35
} ;
36
36
} ;
37
- } ;
37
+ }
38
+ export { whileST as while } ;
38
39
39
- export var for_ = function ( lo ) {
40
+ function forST ( lo ) {
40
41
return function ( hi ) {
41
42
return function ( f ) {
42
43
return function ( ) {
@@ -46,7 +47,8 @@ export var for_ = function (lo) {
46
47
} ;
47
48
} ;
48
49
} ;
49
- } ;
50
+ }
51
+ export { forST as for }
50
52
51
53
export var foreach = function ( as ) {
52
54
return function ( f ) {
@@ -58,11 +60,12 @@ export var foreach = function (as) {
58
60
} ;
59
61
} ;
60
62
61
- export var new = function ( val ) {
63
+ function newSTRef ( val ) {
62
64
return function ( ) {
63
65
return { value : val } ;
64
66
} ;
65
- } ;
67
+ }
68
+ export { newSTRef as new } ;
66
69
67
70
export var read = function ( ref ) {
68
71
return function ( ) {
Original file line number Diff line number Diff line change @@ -86,19 +86,13 @@ foreign import run :: forall a. (forall r. ST r a) -> a
86
86
-- | `while b m` is ST computation which runs the ST computation `b`. If its
87
87
-- | result is `true`, it runs the ST computation `m` and loops. If not, the
88
88
-- | 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
93
90
94
91
-- | Loop over a consecutive collection of numbers
95
92
-- |
96
93
-- | `ST.for lo hi f` runs the computation returned by the function `f` for each
97
94
-- | 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
102
96
103
97
-- | Loop over an array of values.
104
98
-- |
You can’t perform that action at this time.
0 commit comments