1
1
module Unfork
2
2
(
3
3
-- * Asynchronous I/O
4
- unforkAsyncVoidIO ,
5
4
unforkAsyncIO ,
5
+ unforkAsyncIO_ ,
6
6
Future (.. ),
7
7
-- * Asynchronous STM
8
- unforkAsyncVoidSTM ,
9
8
unforkAsyncSTM ,
9
+ unforkAsyncSTM_ ,
10
10
-- * Synchronous I/O
11
11
unforkSyncIO ,
12
- unforkSyncVoidIO ,
12
+ unforkSyncIO_ ,
13
13
) where
14
14
15
15
import Prelude (IO , Bool (.. ), Maybe (.. ), pure )
@@ -44,13 +44,13 @@ import Control.Concurrent.STM.TVar
44
44
-}
45
45
46
46
-- | Turns an IO action into a fire-and-forget STM action
47
- unforkAsyncVoidSTM ::
47
+ unforkAsyncSTM_ ::
48
48
(task -> IO result )
49
49
-- ^ Action that needs to be run serially
50
50
-> ((task -> STM () ) -> IO conclusion )
51
51
-- ^ Continuation with a thread-safe version of the action
52
52
-> IO conclusion
53
- unforkAsyncVoidSTM action =
53
+ unforkAsyncSTM_ action =
54
54
unforkAsync Unfork { threadSafeAction, step }
55
55
where
56
56
threadSafeAction run arg = enqueue run arg
@@ -65,13 +65,13 @@ unforkAsyncVoidSTM action =
65
65
-}
66
66
67
67
-- | Turns an IO action into a fire-and-forget async action
68
- unforkAsyncVoidIO ::
68
+ unforkAsyncIO_ ::
69
69
(task -> IO result )
70
70
-- ^ Action that needs to be run serially
71
71
-> ((task -> IO () ) -> IO conclusion )
72
72
-- ^ Continuation with a thread-safe version of the action
73
73
-> IO conclusion
74
- unforkAsyncVoidIO action =
74
+ unforkAsyncIO_ action =
75
75
unforkAsync Unfork { threadSafeAction, step }
76
76
where
77
77
threadSafeAction run arg = atomically (enqueue run arg)
@@ -160,13 +160,13 @@ unforkSyncIO action continue = do
160
160
161
161
-}
162
162
163
- unforkSyncVoidIO ::
163
+ unforkSyncIO_ ::
164
164
(task -> IO result )
165
165
-- ^ Action that needs to be run serially
166
166
-> ((task -> IO () ) -> IO conclusion )
167
167
-- ^ Continuation with a thread-safe version of the action
168
168
-> IO conclusion
169
- unforkSyncVoidIO action =
169
+ unforkSyncIO_ action =
170
170
unforkSyncIO \ x -> do
171
171
_ <- action x
172
172
pure ()
0 commit comments