diff --git a/CHANGELOG.md b/CHANGELOG.md index ac2a02c..4424fad 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -25,8 +25,9 @@ Breaking changes: New features: - Added `fromKillSignal` (#51 by @JordanMartinez) - Added `pidExists` (#53 by @JordanMartinez) -- Export `toUnsafeChildProcess` (#54 by @JordanMartinez) +- Export `toUnsafeChildProcess` (#55 by @JordanMartinez) - Added `stdio` (#55 by @JordanMartinez) +- Added `Show` instance to `Shell` & `KillSignal` (#58 by @JordanMartinez) Other improvements: - Fix regression: add `ref`/`unref` APIs that were dropped in `v10.0.0` (#50 by @JordanMartinez) diff --git a/src/Node/ChildProcess/Types.js b/src/Node/ChildProcess/Types.js index cad6dce..9a38154 100644 --- a/src/Node/ChildProcess/Types.js +++ b/src/Node/ChildProcess/Types.js @@ -1,3 +1,5 @@ +export const showKillSignal = (ks) => ks + ""; +export const showShell = (shell) => shell + ""; export const fromKillSignalImpl = (left, right, sig) => { const ty = typeof sig; if (ty === "number") return right(sig | 0); diff --git a/src/Node/ChildProcess/Types.purs b/src/Node/ChildProcess/Types.purs index 90c176c..300a60b 100644 --- a/src/Node/ChildProcess/Types.purs +++ b/src/Node/ChildProcess/Types.purs @@ -72,6 +72,11 @@ defaultStdIO = unsafeCoerce (null :: Nullable String) foreign import data KillSignal :: Type +instance Show KillSignal where + show = showKillSignal + +foreign import showKillSignal :: KillSignal -> String + intSignal :: Int -> KillSignal intSignal = unsafeCoerce @@ -85,6 +90,11 @@ foreign import fromKillSignalImpl :: Fn3 (forall l r. l -> Either l r) (forall l foreign import data Shell :: Type +instance Show Shell where + show = showShell + +foreign import showShell :: Shell -> String + enableShell :: Shell enableShell = unsafeCoerce true