@@ -32,10 +32,9 @@ module Node.Stream
3232
3333import Prelude
3434
35- import Control.Bind ((<=<))
3635import Control.Monad.Eff (Eff )
3736import Control.Monad.Eff.Exception (throw , EXCEPTION (), Error ())
38- import Control.Monad.Eff.Unsafe (unsafeInterleaveEff )
37+ import Control.Monad.Eff.Unsafe (unsafeCoerceEff )
3938import Data.Either (Either (..))
4039import Data.Maybe (Maybe (..), fromMaybe )
4140import Node.Buffer (Buffer ())
@@ -118,7 +117,7 @@ readString r size enc = do
118117 case v of
119118 Nothing -> pure Nothing
120119 Just (Left _) -> throw " Stream encoding should not be set"
121- Just (Right buf) -> Just <$> (unsafeInterleaveEff $ Buffer .toString enc buf)
120+ Just (Right buf) -> Just <$> (unsafeCoerceEff $ Buffer .toString enc buf)
122121
123122readEither
124123 :: forall w eff
@@ -145,7 +144,7 @@ onDataString
145144 -> Encoding
146145 -> (String -> Eff (err :: EXCEPTION | eff ) Unit )
147146 -> Eff (err :: EXCEPTION | eff ) Unit
148- onDataString r enc cb = onData r (cb <=< unsafeInterleaveEff <<< Buffer .toString enc)
147+ onDataString r enc cb = onData r (cb <=< unsafeCoerceEff <<< Buffer .toString enc)
149148
150149-- | Listen for `data` events, returning data in an `Either String Buffer`. This
151150-- | function is provided for the (hopefully rare) case that `setEncoding` has
@@ -272,7 +271,7 @@ foreign import setDefaultEncodingImpl
272271-- | function ensures that the encoding is always supplied explicitly).
273272setDefaultEncoding
274273 :: forall r eff
275- . Writable r eff
274+ . Writable r eff
276275 -> Encoding
277276 -> Eff eff Unit
278277setDefaultEncoding r enc = setDefaultEncodingImpl r (show enc)
0 commit comments