@@ -157,28 +157,28 @@ stderr = toUnsafeChildProcess >>> UnsafeCP.unsafeStderr >>> unsafeFromNull
157
157
-- | the process has spawned. Note that if the process has already
158
158
-- | exited, another process may have taken the same ID, so be careful!
159
159
pid :: ChildProcess -> Effect (Maybe Pid )
160
- pid = unsafeCoerce SafeCP .pid
160
+ pid cp = SafeCP .pid $ toUnsafeChildProcess cp
161
161
162
162
pidExists :: ChildProcess -> Effect Boolean
163
- pidExists = unsafeCoerce SafeCP .pidExists
163
+ pidExists cp = SafeCP .pidExists $ toUnsafeChildProcess cp
164
164
165
165
-- | Indicates whether it is still possible to send and receive
166
166
-- | messages from the child process.
167
167
connected :: ChildProcess -> Effect Boolean
168
168
connected = unsafeCoerce SafeCP .connected
169
169
170
170
exitCode :: ChildProcess -> Effect (Maybe Int )
171
- exitCode = unsafeCoerce SafeCP .exitCode
171
+ exitCode cp = SafeCP .exitCode $ toUnsafeChildProcess cp
172
172
173
173
-- | Closes the IPC channel between parent and child.
174
174
disconnect :: ChildProcess -> Effect Unit
175
- disconnect = unsafeCoerce SafeCP .disconnect
175
+ disconnect cp = SafeCP .disconnect $ toUnsafeChildProcess cp
176
176
177
177
kill :: ChildProcess -> Effect Boolean
178
- kill = unsafeCoerce SafeCP .kill
178
+ kill cp = SafeCP .kill $ toUnsafeChildProcess cp
179
179
180
180
kill' :: KillSignal -> ChildProcess -> Effect Boolean
181
- kill' = unsafeCoerce SafeCP .kill'
181
+ kill' sig cp = SafeCP .kill' sig $ toUnsafeChildProcess cp
182
182
183
183
-- | Send a signal to a child process. In the same way as the
184
184
-- | [unix kill(2) system call](https://linux.die.net/man/2/kill),
@@ -189,25 +189,25 @@ kill' = unsafeCoerce SafeCP.kill'
189
189
-- | The child process might emit an `"error"` event if the signal
190
190
-- | could not be delivered.
191
191
killSignal :: Signal -> ChildProcess -> Effect Boolean
192
- killSignal = unsafeCoerce SafeCP .killSignal
192
+ killSignal sig cp = SafeCP .killSignal sig $ toUnsafeChildProcess cp
193
193
194
194
killed :: ChildProcess -> Effect Boolean
195
- killed = unsafeCoerce SafeCP .killed
195
+ killed cp = SafeCP .killed $ toUnsafeChildProcess cp
196
196
197
197
ref :: ChildProcess -> Effect Unit
198
- ref = unsafeCoerce SafeCP .ref
198
+ ref cp = SafeCP .ref $ toUnsafeChildProcess cp
199
199
200
200
unref :: ChildProcess -> Effect Unit
201
- unref = unsafeCoerce SafeCP .unref
201
+ unref cp = SafeCP .unref $ toUnsafeChildProcess cp
202
202
203
203
signalCode :: ChildProcess -> Effect (Maybe String )
204
- signalCode = unsafeCoerce SafeCP .signalCode
204
+ signalCode cp = SafeCP .signalCode $ toUnsafeChildProcess cp
205
205
206
206
spawnArgs :: ChildProcess -> Array String
207
- spawnArgs = unsafeCoerce SafeCP .spawnArgs
207
+ spawnArgs cp = SafeCP .spawnArgs $ toUnsafeChildProcess cp
208
208
209
209
spawnFile :: ChildProcess -> String
210
- spawnFile = unsafeCoerce SafeCP .spawnFile
210
+ spawnFile cp = SafeCP .spawnFile $ toUnsafeChildProcess cp
211
211
212
212
-- | Note: `exitStatus` combines the `status` and `signal` fields
213
213
-- | from the value normally returned by `spawnSync` into one value
0 commit comments