diff --git a/bower.json b/bower.json index dc46400..627ce08 100644 --- a/bower.json +++ b/bower.json @@ -12,15 +12,15 @@ "url": "git://github.com/purescript-node/purescript-node-streams.git" }, "devDependencies": { - "purescript-console": "^1.0.0", - "purescript-assert": "^1.0.0", + "purescript-console": "^2.0.0", + "purescript-assert": "^2.0.0", "purescript-partial": "^1.1.2" }, "dependencies": { - "purescript-eff": "^1.0.0", - "purescript-node-buffer": "^1.0.0", - "purescript-prelude": "^1.0.0", - "purescript-either": "^1.0.0", - "purescript-exceptions": "^1.0.0" + "purescript-eff": "^2.0.0", + "purescript-node-buffer": "^2.0.0", + "purescript-prelude": "^2.1.0", + "purescript-either": "^2.0.0", + "purescript-exceptions": "^2.0.0" } } diff --git a/src/Node/Stream.purs b/src/Node/Stream.purs index 6e45c2e..9981085 100644 --- a/src/Node/Stream.purs +++ b/src/Node/Stream.purs @@ -32,10 +32,9 @@ module Node.Stream import Prelude -import Control.Bind ((<=<)) import Control.Monad.Eff (Eff) import Control.Monad.Eff.Exception (throw, EXCEPTION(), Error()) -import Control.Monad.Eff.Unsafe (unsafeInterleaveEff) +import Control.Monad.Eff.Unsafe (unsafeCoerceEff) import Data.Either (Either(..)) import Data.Maybe (Maybe(..), fromMaybe) import Node.Buffer (Buffer()) @@ -118,7 +117,7 @@ readString r size enc = do case v of Nothing -> pure Nothing Just (Left _) -> throw "Stream encoding should not be set" - Just (Right buf) -> Just <$> (unsafeInterleaveEff $ Buffer.toString enc buf) + Just (Right buf) -> Just <$> (unsafeCoerceEff $ Buffer.toString enc buf) readEither :: forall w eff @@ -145,7 +144,7 @@ onDataString -> Encoding -> (String -> Eff (err :: EXCEPTION | eff) Unit) -> Eff (err :: EXCEPTION | eff) Unit -onDataString r enc cb = onData r (cb <=< unsafeInterleaveEff <<< Buffer.toString enc) +onDataString r enc cb = onData r (cb <=< unsafeCoerceEff <<< Buffer.toString enc) -- | Listen for `data` events, returning data in an `Either String Buffer`. This -- | function is provided for the (hopefully rare) case that `setEncoding` has @@ -272,7 +271,7 @@ foreign import setDefaultEncodingImpl -- | function ensures that the encoding is always supplied explicitly). setDefaultEncoding :: forall r eff - . Writable r eff + . Writable r eff -> Encoding -> Eff eff Unit setDefaultEncoding r enc = setDefaultEncodingImpl r (show enc)