Skip to content

Commit 20c3c61

Browse files
Fix FFI (#55)
1 parent 85a1e79 commit 20c3c61

File tree

3 files changed

+13
-5
lines changed

3 files changed

+13
-5
lines changed

CHANGELOG.md

+8
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,14 @@ Bugfixes:
1212

1313
Other improvements:
1414

15+
## Next
16+
17+
Breaking changes:
18+
- Correct type signature for `pipeline`
19+
20+
Bugfixes:
21+
- Fix FFI for `isPaused` and `pause`
22+
1523
## [v8.0.0](https://github.com/purescript-node/purescript-node-streams/releases/tag/v8.0.0) - 2022-07-19
1624

1725
Breaking changes:

src/Node/Stream.js

+2-2
Original file line numberDiff line numberDiff line change
@@ -28,9 +28,9 @@ export const readableLengthImpl = (r) => r.readableLength;
2828

2929
export const resumeImpl = (r) => r.resume();
3030

31-
export const pauseImpl = (r) => r.pause;
31+
export const pauseImpl = (r) => r.pause();
3232

33-
export const isPausedImpl = (r) => r.isPaused;
33+
export const isPausedImpl = (r) => r.isPaused();
3434

3535
export const pipeImpl = (r, w) => r.pipe(w);
3636

src/Node/Stream.purs

+3-3
Original file line numberDiff line numberDiff line change
@@ -488,10 +488,10 @@ allowHalfOpen d = runEffectFn1 allowHalfOpenImpl d
488488

489489
foreign import allowHalfOpenImpl :: EffectFn1 (Duplex) (Boolean)
490490

491-
pipeline :: forall w r. Readable w -> Array Duplex -> Writable r -> (Error -> Effect Unit) -> Effect Unit
492-
pipeline src transforms dest cb = runEffectFn4 pipelineImpl src transforms dest cb
491+
pipeline :: forall w r. Readable w -> Array Duplex -> Writable r -> (Maybe Error -> Effect Unit) -> Effect Unit
492+
pipeline src transforms dest cb = runEffectFn4 pipelineImpl src transforms dest $ mkEffectFn1 \err -> cb (toMaybe err)
493493

494-
foreign import pipelineImpl :: forall w r. EffectFn4 (Readable w) (Array Duplex) (Writable r) ((Error -> Effect Unit)) (Unit)
494+
foreign import pipelineImpl :: forall w r. EffectFn4 (Readable w) (Array Duplex) (Writable r) (EffectFn1 (Nullable Error) Unit) (Unit)
495495

496496
readableFromString :: String -> Encoding -> Effect (Readable ())
497497
readableFromString str enc = runEffectFn2 readableFromStrImpl str (encodingToNode enc)

0 commit comments

Comments
 (0)