Skip to content

Commit e907271

Browse files
Add Show instance to Shell/KillSignal (#58)
1 parent 258e3a9 commit e907271

File tree

3 files changed

+14
-1
lines changed

3 files changed

+14
-1
lines changed

CHANGELOG.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,8 +25,9 @@ Breaking changes:
2525
New features:
2626
- Added `fromKillSignal` (#51 by @JordanMartinez)
2727
- Added `pidExists` (#53 by @JordanMartinez)
28-
- Export `toUnsafeChildProcess` (#54 by @JordanMartinez)
28+
- Export `toUnsafeChildProcess` (#55 by @JordanMartinez)
2929
- Added `stdio` (#55 by @JordanMartinez)
30+
- Added `Show` instance to `Shell` & `KillSignal` (#58 by @JordanMartinez)
3031

3132
Other improvements:
3233
- Fix regression: add `ref`/`unref` APIs that were dropped in `v10.0.0` (#50 by @JordanMartinez)

src/Node/ChildProcess/Types.js

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
export const showKillSignal = (ks) => ks + "";
2+
export const showShell = (shell) => shell + "";
13
export const fromKillSignalImpl = (left, right, sig) => {
24
const ty = typeof sig;
35
if (ty === "number") return right(sig | 0);

src/Node/ChildProcess/Types.purs

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -72,6 +72,11 @@ defaultStdIO = unsafeCoerce (null :: Nullable String)
7272

7373
foreign import data KillSignal :: Type
7474

75+
instance Show KillSignal where
76+
show = showKillSignal
77+
78+
foreign import showKillSignal :: KillSignal -> String
79+
7580
intSignal :: Int -> KillSignal
7681
intSignal = unsafeCoerce
7782

@@ -85,6 +90,11 @@ foreign import fromKillSignalImpl :: Fn3 (forall l r. l -> Either l r) (forall l
8590

8691
foreign import data Shell :: Type
8792

93+
instance Show Shell where
94+
show = showShell
95+
96+
foreign import showShell :: Shell -> String
97+
8898
enableShell :: Shell
8999
enableShell = unsafeCoerce true
90100

0 commit comments

Comments
 (0)