@@ -157,28 +157,28 @@ stderr = toUnsafeChildProcess >>> UnsafeCP.unsafeStderr >>> unsafeFromNull
157157-- | the process has spawned. Note that if the process has already
158158-- | exited, another process may have taken the same ID, so be careful!
159159pid :: ChildProcess -> Effect (Maybe Pid )
160- pid = unsafeCoerce SafeCP .pid
160+ pid cp = SafeCP .pid $ toUnsafeChildProcess cp
161161
162162pidExists :: ChildProcess -> Effect Boolean
163- pidExists = unsafeCoerce SafeCP .pidExists
163+ pidExists cp = SafeCP .pidExists $ toUnsafeChildProcess cp
164164
165165-- | Indicates whether it is still possible to send and receive
166166-- | messages from the child process.
167167connected :: ChildProcess -> Effect Boolean
168168connected = unsafeCoerce SafeCP .connected
169169
170170exitCode :: ChildProcess -> Effect (Maybe Int )
171- exitCode = unsafeCoerce SafeCP .exitCode
171+ exitCode cp = SafeCP .exitCode $ toUnsafeChildProcess cp
172172
173173-- | Closes the IPC channel between parent and child.
174174disconnect :: ChildProcess -> Effect Unit
175- disconnect = unsafeCoerce SafeCP .disconnect
175+ disconnect cp = SafeCP .disconnect $ toUnsafeChildProcess cp
176176
177177kill :: ChildProcess -> Effect Boolean
178- kill = unsafeCoerce SafeCP .kill
178+ kill cp = SafeCP .kill $ toUnsafeChildProcess cp
179179
180180kill' :: KillSignal -> ChildProcess -> Effect Boolean
181- kill' = unsafeCoerce SafeCP .kill'
181+ kill' sig cp = SafeCP .kill' sig $ toUnsafeChildProcess cp
182182
183183-- | Send a signal to a child process. In the same way as the
184184-- | [unix kill(2) system call](https://linux.die.net/man/2/kill),
@@ -189,25 +189,25 @@ kill' = unsafeCoerce SafeCP.kill'
189189-- | The child process might emit an `"error"` event if the signal
190190-- | could not be delivered.
191191killSignal :: Signal -> ChildProcess -> Effect Boolean
192- killSignal = unsafeCoerce SafeCP .killSignal
192+ killSignal sig cp = SafeCP .killSignal sig $ toUnsafeChildProcess cp
193193
194194killed :: ChildProcess -> Effect Boolean
195- killed = unsafeCoerce SafeCP .killed
195+ killed cp = SafeCP .killed $ toUnsafeChildProcess cp
196196
197197ref :: ChildProcess -> Effect Unit
198- ref = unsafeCoerce SafeCP .ref
198+ ref cp = SafeCP .ref $ toUnsafeChildProcess cp
199199
200200unref :: ChildProcess -> Effect Unit
201- unref = unsafeCoerce SafeCP .unref
201+ unref cp = SafeCP .unref $ toUnsafeChildProcess cp
202202
203203signalCode :: ChildProcess -> Effect (Maybe String )
204- signalCode = unsafeCoerce SafeCP .signalCode
204+ signalCode cp = SafeCP .signalCode $ toUnsafeChildProcess cp
205205
206206spawnArgs :: ChildProcess -> Array String
207- spawnArgs = unsafeCoerce SafeCP .spawnArgs
207+ spawnArgs cp = SafeCP .spawnArgs $ toUnsafeChildProcess cp
208208
209209spawnFile :: ChildProcess -> String
210- spawnFile = unsafeCoerce SafeCP .spawnFile
210+ spawnFile cp = SafeCP .spawnFile $ toUnsafeChildProcess cp
211211
212212-- | Note: `exitStatus` combines the `status` and `signal` fields
213213-- | from the value normally returned by `spawnSync` into one value
0 commit comments