Skip to content

10.0/2.0 upgrades #10

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Oct 17, 2016
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 7 additions & 7 deletions bower.json
Original file line number Diff line number Diff line change
Expand Up @@ -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"
}
}
9 changes: 4 additions & 5 deletions src/Node/Stream.purs
Original file line number Diff line number Diff line change
Expand Up @@ -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())
Expand Down Expand Up @@ -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
Expand All @@ -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
Expand Down Expand Up @@ -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)
Expand Down