diff --git a/spago.lock b/spago.lock index 768b597..1b8e2df 100644 --- a/spago.lock +++ b/spago.lock @@ -13,7 +13,6 @@ workspace: - lists: ">=7.0.0 <8.0.0" - maybe: ">=6.0.0 <7.0.0" - mmorph: ">=7.0.0 <8.0.0" - - newtype: ">=5.0.0 <6.0.0" - node-buffer: ">=9.0.0 <10.0.0" - node-event-emitter: ">=3.0.0 <4.0.0" - node-fs: ">=9.1.0 <10.0.0" diff --git a/spago.yaml b/spago.yaml index 27c5b52..2dec2be 100644 --- a/spago.yaml +++ b/spago.yaml @@ -20,7 +20,6 @@ package: - lists: ">=7.0.0 <8.0.0" - maybe: ">=6.0.0 <7.0.0" - mmorph: ">=7.0.0 <8.0.0" - - newtype: ">=5.0.0 <6.0.0" - node-buffer: ">=9.0.0 <10.0.0" - node-event-emitter: ">=3.0.0 <4.0.0" - node-fs: ">=9.1.0 <10.0.0" diff --git a/src/Pipes.CSV.Parse.purs b/src/Pipes.CSV.Parse.purs deleted file mode 100644 index e460df4..0000000 --- a/src/Pipes.CSV.Parse.purs +++ /dev/null @@ -1 +0,0 @@ -module Pipes.CSV.Parse where diff --git a/src/Pipes.Node.Stream.purs b/src/Pipes.Node.Stream.purs index f67626a..2039fa8 100644 --- a/src/Pipes.Node.Stream.purs +++ b/src/Pipes.Node.Stream.purs @@ -8,10 +8,8 @@ import Control.Monad.ST.Class (liftST) import Control.Monad.ST.Ref as STRef import Control.Monad.Trans.Class (lift) import Data.Maybe (Maybe(..)) -import Data.Newtype (wrap) import Data.Traversable (for_) import Data.Tuple.Nested ((/\)) -import Effect.Aff (delay) import Effect.Aff.Class (class MonadAff, liftAff) import Effect.Class (liftEffect) import Effect.Exception (Error) @@ -34,7 +32,6 @@ fromReadable r = pure $ Done unit go { error, cancel } = do - liftAff $ delay $ wrap 0.0 err <- liftEffect $ liftST $ STRef.read error for_ err throwError @@ -62,7 +59,6 @@ fromWritable w = pure $ Done unit go { error, cancel } = do - liftAff $ delay $ wrap 0.0 err <- liftEffect $ liftST $ STRef.read error for_ err throwError @@ -96,7 +92,6 @@ fromTransform t = pure $ Done unit yieldFromReadableHalf = flip tailRecM unit $ const do - liftAff $ delay $ wrap 0.0 res <- liftEffect (O.read t) case res of O.ReadJust a -> do @@ -105,11 +100,9 @@ fromTransform t = O.ReadWouldBlock -> pure $ Done unit O.ReadClosed -> yield Nothing $> Done unit go { error, cancel } = do - liftAff $ delay $ wrap 0.0 err <- liftEffect $ liftST $ STRef.read error for_ err throwError - yieldFromReadableHalf ma <- await case ma of Nothing -> cleanup cancel @@ -120,6 +113,7 @@ fromTransform t = O.WriteClosed -> cleanup cancel O.WriteOk -> pure $ Loop { error, cancel } O.WriteWouldBlock -> do + yieldFromReadableHalf liftAff $ O.awaitWritableOrClosed t pure $ Loop { error, cancel } in