Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Bump to conduit-1.0

  • Loading branch information...
commit 800623f74252558a6922a383b99f5d9f93d4d6f4 1 parent af01221
Ben Gamari bgamari authored
Showing with 8 additions and 7 deletions.
  1. +6 −5 Data/Conduit/Process.hs
  2. +2 −2 process-conduit.cabal
11 Data/Conduit/Process.hs
View
@@ -36,7 +36,7 @@ bufSize = 64 * 1024
conduitProcess
:: MonadResource m
=> CreateProcess
- -> GConduit S.ByteString m S.ByteString
+ -> Conduit S.ByteString m S.ByteString
conduitProcess cp = bracketP createp closep $ \(Just cin, Just cout, _, ph) -> do
end <- repeatLoopT $ do
-- if process's outputs are available, then yields them.
@@ -80,6 +80,7 @@ conduitProcess cp = bracketP createp closep $ \(Just cin, Just cout, _, ph) -> d
hClose cout
_ <- waitForProcess' ph
return ()
+ closep _ = error "Data.Conduit.Process.closep: Unhandled case"
hReady' h =
hReady h `E.catch` \(E.SomeException _) -> return False
@@ -87,13 +88,13 @@ conduitProcess cp = bracketP createp closep $ \(Just cin, Just cout, _, ph) -> d
waitForProcess ph `E.catch` \(E.SomeException _) -> return ExitSuccess
-- | Source of process
-sourceProcess :: MonadResource m => CreateProcess -> GSource m S.ByteString
-sourceProcess cp = CL.sourceNull >+> conduitProcess cp
+sourceProcess :: MonadResource m => CreateProcess -> Producer m S.ByteString
+sourceProcess cp = toProducer $ CL.sourceNull $= conduitProcess cp
-- | Conduit of shell command
-conduitCmd :: MonadResource m => String -> GConduit S.ByteString m S.ByteString
+conduitCmd :: MonadResource m => String -> Conduit S.ByteString m S.ByteString
conduitCmd = conduitProcess . shell
-- | Source of shell command
-sourceCmd :: MonadResource m => String -> GSource m S.ByteString
+sourceCmd :: MonadResource m => String -> Producer m S.ByteString
sourceCmd = sourceProcess . shell
4 process-conduit.cabal
View
@@ -1,5 +1,5 @@
name: process-conduit
-version: 0.5.0.4
+version: 1.0.0.0
synopsis: Conduits for processes
description:
@@ -33,7 +33,7 @@ library
, bytestring >= 0.9
, text >= 0.11
, process >= 1.0
- , conduit == 0.5.*
+ , conduit == 1.0.*
, shakespeare-text >= 1.0
ghc-options: -Wall
Please sign in to comment.
Something went wrong with that request. Please try again.