@@ -32,10 +32,9 @@ module Node.Stream
32
32
33
33
import Prelude
34
34
35
- import Control.Bind ((<=<))
36
35
import Control.Monad.Eff (Eff )
37
36
import Control.Monad.Eff.Exception (throw , EXCEPTION (), Error ())
38
- import Control.Monad.Eff.Unsafe (unsafeInterleaveEff )
37
+ import Control.Monad.Eff.Unsafe (unsafeCoerceEff )
39
38
import Data.Either (Either (..))
40
39
import Data.Maybe (Maybe (..), fromMaybe )
41
40
import Node.Buffer (Buffer ())
@@ -118,7 +117,7 @@ readString r size enc = do
118
117
case v of
119
118
Nothing -> pure Nothing
120
119
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)
122
121
123
122
readEither
124
123
:: forall w eff
@@ -145,7 +144,7 @@ onDataString
145
144
-> Encoding
146
145
-> (String -> Eff (err :: EXCEPTION | eff ) Unit )
147
146
-> 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)
149
148
150
149
-- | Listen for `data` events, returning data in an `Either String Buffer`. This
151
150
-- | function is provided for the (hopefully rare) case that `setEncoding` has
@@ -272,7 +271,7 @@ foreign import setDefaultEncodingImpl
272
271
-- | function ensures that the encoding is always supplied explicitly).
273
272
setDefaultEncoding
274
273
:: forall r eff
275
- . Writable r eff
274
+ . Writable r eff
276
275
-> Encoding
277
276
-> Eff eff Unit
278
277
setDefaultEncoding r enc = setDefaultEncodingImpl r (show enc)
0 commit comments