Skip to content

Commit 6781dbf

Browse files
authored
Merge pull request #14 from purescript/no-row-effect
Update for purescript-effect
2 parents b938bda + 6b55116 commit 6781dbf

File tree

4 files changed

+8
-27
lines changed

4 files changed

+8
-27
lines changed

bower.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,6 @@
1717
"package.json"
1818
],
1919
"dependencies": {
20-
"purescript-eff": "^3.0.0"
20+
"purescript-effect": "^0.1.0"
2121
}
2222
}

src/Control/Monad/Eff/Ref/Unsafe.purs

Lines changed: 0 additions & 16 deletions
This file was deleted.
Lines changed: 7 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -4,32 +4,29 @@
44
-- | _Note_: The `Control.Monad.ST` provides a _safe_ alternative
55
-- | to global mutable variables when mutation is restricted to a
66
-- | local scope.
7-
module Control.Monad.Eff.Ref where
7+
module Control.Monad.Effect.Ref where
88

9+
import Control.Monad.Effect (Effect)
910
import Prelude (Unit, unit)
10-
import Control.Monad.Eff (Eff, kind Effect)
11-
12-
-- | The effect associated with the use of global mutable variables.
13-
foreign import data REF :: Effect
1411

1512
-- | A value of type `Ref a` represents a mutable reference
1613
-- | which holds a value of type `a`.
1714
foreign import data Ref :: Type -> Type
1815

1916
-- | Create a new mutable reference containing the specified value.
20-
foreign import newRef :: forall s r. s -> Eff (ref :: REF | r) (Ref s)
17+
foreign import newRef :: forall s. s -> Effect (Ref s)
2118

2219
-- | Read the current value of a mutable reference
23-
foreign import readRef :: forall s r. Ref s -> Eff (ref :: REF | r) s
20+
foreign import readRef :: forall s. Ref s -> Effect s
2421

2522
-- | Update the value of a mutable reference by applying a function
2623
-- | to the current value.
27-
foreign import modifyRef' :: forall s b r. Ref s -> (s -> { state :: s, value :: b }) -> Eff (ref :: REF | r) b
24+
foreign import modifyRef' :: forall s b. Ref s -> (s -> { state :: s, value :: b }) -> Effect b
2825

2926
-- | Update the value of a mutable reference by applying a function
3027
-- | to the current value.
31-
modifyRef :: forall s r. Ref s -> (s -> s) -> Eff (ref :: REF | r) Unit
28+
modifyRef :: forall s. Ref s -> (s -> s) -> Effect Unit
3229
modifyRef ref f = modifyRef' ref (\s -> { state: f s, value: unit })
3330

3431
-- | Update the value of a mutable reference to the specified value.
35-
foreign import writeRef :: forall s r. Ref s -> s -> Eff (ref :: REF | r) Unit
32+
foreign import writeRef :: forall s. Ref s -> s -> Effect Unit

0 commit comments

Comments
 (0)