Skip to content

Commit

Permalink
Fix FFI (#55)
Browse files Browse the repository at this point in the history
  • Loading branch information
JordanMartinez authored Jul 26, 2023
1 parent 85a1e79 commit 20c3c61
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 5 deletions.
8 changes: 8 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,14 @@ Bugfixes:

Other improvements:

## Next

Breaking changes:
- Correct type signature for `pipeline`

Bugfixes:
- Fix FFI for `isPaused` and `pause`

## [v8.0.0](https://github.com/purescript-node/purescript-node-streams/releases/tag/v8.0.0) - 2022-07-19

Breaking changes:
Expand Down
4 changes: 2 additions & 2 deletions src/Node/Stream.js
Original file line number Diff line number Diff line change
Expand Up @@ -28,9 +28,9 @@ export const readableLengthImpl = (r) => r.readableLength;

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

export const pauseImpl = (r) => r.pause;
export const pauseImpl = (r) => r.pause();

export const isPausedImpl = (r) => r.isPaused;
export const isPausedImpl = (r) => r.isPaused();

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

Expand Down
6 changes: 3 additions & 3 deletions src/Node/Stream.purs
Original file line number Diff line number Diff line change
Expand Up @@ -488,10 +488,10 @@ allowHalfOpen d = runEffectFn1 allowHalfOpenImpl d

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

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

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

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

0 comments on commit 20c3c61

Please sign in to comment.