Skip to content

Commit cc084e1

Browse files
committed
Refine imports
1 parent dbd34c1 commit cc084e1

File tree

2 files changed

+20
-14
lines changed

2 files changed

+20
-14
lines changed

src/Control/Monad/Eff/Ref.purs

Lines changed: 13 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77

88
module Control.Monad.Eff.Ref where
99

10-
import Control.Monad.Eff
10+
import Control.Monad.Eff (Eff())
1111

1212
-- | The effect associated with the use of global mutable variables.
1313
foreign import data REF :: !
@@ -17,26 +17,29 @@ foreign import data REF :: !
1717
foreign import data Ref :: * -> *
1818

1919
-- | Create a new mutable reference containing the specified value.
20-
foreign import newRef """
20+
foreign import newRef
21+
"""
2122
function newRef(val) {
2223
return function () {
2324
return { value: val };
2425
};
2526
}
26-
""" :: forall s r. s -> Eff (ref :: REF | r) (Ref s)
27+
""" :: forall s r. s -> Eff (ref :: REF | r) (Ref s)
2728

2829
-- | Read the current value of a mutable reference
29-
foreign import readRef """
30+
foreign import readRef
31+
"""
3032
function readRef(ref) {
3133
return function() {
3234
return ref.value;
3335
};
3436
}
35-
""" :: forall s r. Ref s -> Eff (ref :: REF | r) s
37+
""" :: forall s r. Ref s -> Eff (ref :: REF | r) s
3638

3739
-- | Update the value of a mutable reference by applying a function
3840
-- | to the current value.
39-
foreign import modifyRef' """
41+
foreign import modifyRef'
42+
"""
4043
function modifyRef$prime(ref) {
4144
return function(f) {
4245
return function() {
@@ -46,15 +49,16 @@ foreign import modifyRef' """
4649
};
4750
};
4851
}
49-
""" :: forall s b r. Ref s -> (s -> { state :: s, value :: b }) -> Eff (ref :: REF | r) b
52+
""" :: forall s b r. Ref s -> (s -> { state :: s, value :: b }) -> Eff (ref :: REF | r) b
5053

5154
-- | Update the value of a mutable reference by applying a function
5255
-- | to the current value.
5356
modifyRef :: forall s r. Ref s -> (s -> s) -> Eff (ref :: REF | r) Unit
5457
modifyRef ref f = modifyRef' ref (\s -> { state: f s, value: unit })
5558

5659
-- | Update the value of a mutable reference to the specified value.
57-
foreign import writeRef """
60+
foreign import writeRef
61+
"""
5862
function writeRef(ref) {
5963
return function(val) {
6064
return function() {
@@ -63,4 +67,4 @@ foreign import writeRef """
6367
};
6468
};
6569
}
66-
""" :: forall s r. Ref s -> s -> Eff (ref :: REF | r) Unit
70+
""" :: forall s r. Ref s -> s -> Eff (ref :: REF | r) Unit

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

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
module Control.Monad.Eff.Ref.Unsafe where
44

5-
import Control.Monad.Eff
5+
import Control.Monad.Eff (Eff())
66
import Control.Monad.Eff.Ref
77

88
-- | This handler function unsafely removes the `Ref` effect from an
@@ -11,7 +11,9 @@ import Control.Monad.Eff.Ref
1111
-- | This function might be used when it is impossible to prove to the
1212
-- | typechecker that a particular mutable reference does not escape
1313
-- | its scope.
14-
foreign import unsafeRunRef
15-
"function unsafeRunRef(f) {\
16-
\ return f;\
17-
\}" :: forall eff a. Eff (ref :: REF | eff) a -> Eff eff a
14+
foreign import unsafeRunRef
15+
"""
16+
function unsafeRunRef(f) {
17+
return f;
18+
}
19+
""" :: forall eff a. Eff (ref :: REF | eff) a -> Eff eff a

0 commit comments

Comments
 (0)