Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/Control/Monad/ST/Internal.js
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ exports.read = function (ref) {
};
};

exports["modify'"] = function (f) {
exports.modifyImpl = function (f) {
return function (ref) {
return function () {
var t = f(ref.value);
Expand Down
20 changes: 18 additions & 2 deletions src/Control/Monad/ST/Internal.purs
Original file line number Diff line number Diff line change
@@ -1,4 +1,17 @@
module Control.Monad.ST.Internal where
module Control.Monad.ST.Internal
( kind Region
, ST
, run
, while
, for
, foreach
, STRef
, new
, read
, modify'
, modify
, write
) where

import Prelude

Expand Down Expand Up @@ -98,7 +111,10 @@ foreign import read :: forall a r. STRef r a -> ST r a
-- | Update the value of a mutable reference by applying a function
-- | to the current value, computing a new state value for the reference and
-- | a return value.
foreign import modify' :: forall r a b. (a -> { state :: a, value :: b }) -> STRef r a -> ST r b
modify' :: forall r a b. (a -> { state :: a, value :: b }) -> STRef r a -> ST r b
modify' = modifyImpl

foreign import modifyImpl :: forall r a b. (a -> { state :: a, value :: b }) -> STRef r a -> ST r b

-- | Modify the value of a mutable reference by applying a function to the
-- | current value. The modified value is returned.
Expand Down