Skip to content

Commit 435b846

Browse files
committed
Remove unused Prelude import
1 parent 2b34c2c commit 435b846

File tree

1 file changed

+38
-16
lines changed

1 file changed

+38
-16
lines changed

src/Control/Monad/ST.purs

Lines changed: 38 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1,42 +1,64 @@
11
module Control.Monad.ST where
22

3-
import Prelude
4-
53
import Control.Monad.Eff (Eff(), runPure)
64

7-
-- | The `ST` effect represents _local mutation_, i.e. mutation which does not "escape" into the surrounding computation.
5+
-- | The `ST` effect represents _local mutation_, i.e. mutation which does not
6+
-- | "escape" into the surrounding computation.
87
-- |
9-
-- | An `ST` computation is parameterized by a phantom type which is used to restrict the set of reference cells it is allowed to access.
8+
-- | An `ST` computation is parameterized by a phantom type which is used to
9+
-- | restrict the set of reference cells it is allowed to access.
1010
-- |
1111
-- | The `runST` function can be used to handle the `ST` effect.
1212
foreign import data ST :: * -> !
1313

14-
-- | The type `STRef s a` represents a mutable reference holding a value of type `a`, which can be used with the `ST s` effect.
14+
-- | The type `STRef s a` represents a mutable reference holding a value of
15+
-- | type `a`, which can be used with the `ST s` effect.
1516
foreign import data STRef :: * -> * -> *
1617

1718
-- | Create a new mutable reference.
18-
foreign import newSTRef :: forall a h r. a -> Eff (st :: ST h | r) (STRef h a)
19+
foreign import newSTRef
20+
:: forall a h r
21+
. a
22+
-> Eff (st :: ST h | r) (STRef h a)
1923

2024
-- | Read the current value of a mutable reference.
21-
foreign import readSTRef :: forall a h r. STRef h a -> Eff (st :: ST h | r) a
25+
foreign import readSTRef
26+
:: forall a h r
27+
. STRef h a
28+
-> Eff (st :: ST h | r) a
2229

23-
-- | Modify the value of a mutable reference by applying a function to the current value.
24-
foreign import modifySTRef :: forall a h r. STRef h a -> (a -> a) -> Eff (st :: ST h | r) a
30+
-- | Modify the value of a mutable reference by applying a function to the
31+
-- | current value.
32+
foreign import modifySTRef
33+
:: forall a h r
34+
. STRef h a -> (a -> a)
35+
-> Eff (st :: ST h | r) a
2536

2637
-- | Set the value of a mutable reference.
27-
foreign import writeSTRef :: forall a h r. STRef h a -> a -> Eff (st :: ST h | r) a
38+
foreign import writeSTRef
39+
:: forall a h r
40+
. STRef h a
41+
-> a
42+
-> Eff (st :: ST h | r) a
2843

2944
-- | Run an `ST` computation.
3045
-- |
31-
-- | Note: the type of `runST` uses a rank-2 type to constrain the phantom type `s`, such that the computation must not leak any mutable references
46+
-- | Note: the type of `runST` uses a rank-2 type to constrain the phantom
47+
-- | type `s`, such that the computation must not leak any mutable references
3248
-- | to the surrounding computation.
3349
-- |
34-
-- | It may cause problems to apply this function using the `$` operator. The recommended approach is to use parentheses instead.
35-
foreign import runST :: forall a r. (forall h. Eff (st :: ST h | r) a) -> Eff r a
50+
-- | It may cause problems to apply this function using the `$` operator. The
51+
-- | recommended approach is to use parentheses instead.
52+
foreign import runST
53+
:: forall a r
54+
. (forall h. Eff (st :: ST h | r) a)
55+
-> Eff r a
3656

37-
-- | A convenience function which combines `runST` with `runPure`, which can be used when the only required effect is `ST`.
57+
-- | A convenience function which combines `runST` with `runPure`, which can be
58+
-- | used when the only required effect is `ST`.
3859
-- |
39-
-- | Note: since this function has a rank-2 type, it may cause problems to apply this function using the `$` operator. The recommended approach
40-
-- | is to use parentheses instead.
60+
-- | Note: since this function has a rank-2 type, it may cause problems to apply
61+
-- | this function using the `$` operator. The recommended approach is to use
62+
-- | parentheses instead.
4163
pureST :: forall a. (forall h. Eff (st :: ST h) a) -> a
4264
pureST st = runPure (runST st)

0 commit comments

Comments
 (0)