File tree Expand file tree Collapse file tree 2 files changed +19
-3
lines changed Expand file tree Collapse file tree 2 files changed +19
-3
lines changed Original file line number Diff line number Diff line change @@ -70,7 +70,7 @@ exports.read = function (ref) {
70
70
} ;
71
71
} ;
72
72
73
- exports [ "modify'" ] = function ( f ) {
73
+ exports . modifyImpl = function ( f ) {
74
74
return function ( ref ) {
75
75
return function ( ) {
76
76
var t = f ( ref . value ) ;
Original file line number Diff line number Diff line change 1
- module Control.Monad.ST.Internal where
1
+ module Control.Monad.ST.Internal
2
+ ( kind Region
3
+ , ST
4
+ , run
5
+ , while
6
+ , for
7
+ , foreach
8
+ , STRef
9
+ , new
10
+ , read
11
+ , modify'
12
+ , modify
13
+ , write
14
+ ) where
2
15
3
16
import Prelude
4
17
@@ -98,7 +111,10 @@ foreign import read :: forall a r. STRef r a -> ST r a
98
111
-- | Update the value of a mutable reference by applying a function
99
112
-- | to the current value, computing a new state value for the reference and
100
113
-- | a return value.
101
- foreign import modify' :: forall r a b . (a -> { state :: a , value :: b } ) -> STRef r a -> ST r b
114
+ modify' :: forall r a b . (a -> { state :: a , value :: b } ) -> STRef r a -> ST r b
115
+ modify' = modifyImpl
116
+
117
+ foreign import modifyImpl :: forall r a b . (a -> { state :: a , value :: b } ) -> STRef r a -> ST r b
102
118
103
119
-- | Modify the value of a mutable reference by applying a function to the
104
120
-- | current value. The modified value is returned.
You can’t perform that action at this time.
0 commit comments