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) {
7070 } ;
7171} ;
7272
73- exports [ "modify'" ] = function ( f ) {
73+ exports . modifyImpl = function ( f ) {
7474 return function ( ref ) {
7575 return function ( ) {
7676 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
215
316import Prelude
417
@@ -98,7 +111,10 @@ foreign import read :: forall a r. STRef r a -> ST r a
98111-- | Update the value of a mutable reference by applying a function
99112-- | to the current value, computing a new state value for the reference and
100113-- | 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
102118
103119-- | Modify the value of a mutable reference by applying a function to the
104120-- | current value. The modified value is returned.
You can’t perform that action at this time.
0 commit comments