process-extras 0.7 → 0.7.1
raw patch · 5 files changed
+22/−8 lines, 5 files
Files
- .ghci +2/−0
- README.md +6/−6
- changelog +12/−0
- process-extras.cabal +1/−1
- src/System/Process/Text.hs +1/−1
.ghci view
@@ -1,5 +1,7 @@ :set -isrc+:set -XFlexibleContexts :set -DMIN_VERSION_deepseq(a,b,c)=1 :set -DMIN_VERSION_bytestring(a,b,c)=1+:set -DMIN_VERSION_base(a,b,c)=1 :load Tests
README.md view
@@ -25,13 +25,13 @@ function: > :m +System.Process.ListLike Data.ByteString Data.Text.Lazy- > readCreateProcessWithExitCode (shell "echo 'λ'") mempty :: IO (ExitCode, ByteString, ByteString)+ > readCreateProcess (shell "echo 'λ'") mempty :: IO (ExitCode, ByteString, ByteString) (ExitSuccess,"\206\187\n","")- > readCreateProcessWithExitCode (shell "echo 'λ'") mempty :: IO (ExitCode, Text, Text)+ > readCreateProcess (shell "echo 'λ'") mempty :: IO (ExitCode, Text, Text) (ExitSuccess,"\955\n","")- > readCreateProcessWithExitCode (shell "echo 'λ'") mempty :: IO (ExitCode, String, String)+ > readCreateProcess (shell "echo 'λ'") mempty :: IO (ExitCode, String, String) (ExitSuccess,"\955\n","")- > System.Process.Text.readCreateProcessWithExitCode (shell "yes | head -10") mempty+ > readCreateProcess (shell "yes | head -10") mempty :: IO (ExitCode, Text, Text) (ExitSuccess,"y\ny\ny\ny\ny\ny\ny\ny\ny\ny\n","") Although the output *type* can be lazy, normal process functions still@@ -50,7 +50,7 @@ provided. [Chunk a] can be converted to any other instance of ProcessOutput using collectOutput - > (readCreateProcess (shell "gzip -v < /proc/uptime") mempty :: IO [Chunk ByteString]) >>= mapM_ (putStrLn . show)+ > (readCreateProcess (shell "gzip -v < /proc/uptime") mempty :: IO [Chunk ByteString]) >>= mapM_ (Prelude.putStrLn . show) Stdout "\US\139\b\NUL\237\136\&7W\NUL\ETX345\183\&403\215\&31Q04267\177\&0\177\212\&33\225\STX\NUL_\169\142\178\ETB\NUL\NUL\NUL" Stderr "gzip: stdin: file size changed while zipping\n -8.7%\n" Result ExitSuccess@@ -60,7 +60,7 @@ (ExitSuccess,"\US\139\b\NUL\185\137\&7W\NUL\ETX345\183\&427\212\&33W0426731\177\208\&35\225\STX\NUL\237\192\CAN\224\ETB\NUL\NUL\NUL","gzip: stdin: file size changed while zipping\n -8.7%\n") > collectOutput <$> (readCreateProcess (shell "gzip -v < /proc/uptime") mempty :: IO [Chunk ByteString]) :: IO (ExitCode, ByteString, ByteString) (ExitSuccess,"\US\139\b\NUL\185\137\&7W\NUL\ETX345\183\&427\212\&33W0426731\177\208\&35\225\STX\NUL\237\192\CAN\224\ETB\NUL\NUL\NUL","gzip: stdin: file size changed while zipping\n -8.7%\n")- > (collectOutput . filter (\x -> case x of Stderr _ -> False; _ -> True)) <$> (readCreateProcess (shell "gzip -v < /proc/uptime") mempty :: IO [Chunk ByteString]) :: IO (ExitCode, ByteString, ByteString)+ > (collectOutput . Prelude.filter (\x -> case x of Stderr _ -> False; _ -> True)) <$> (readCreateProcess (shell "gzip -v < /proc/uptime") mempty :: IO [Chunk ByteString]) :: IO (ExitCode, ByteString, ByteString) (ExitSuccess,"\US\139\b\NUL<\138\&7W\NUL\ETX345\183\&410\210\&3\176P04267713\213\&37\224\STX\NULT\142\EOT\165\ETB\NUL\NUL\NUL","") Some cases that need investigation:
changelog view
@@ -1,3 +1,15 @@+haskell-process-extras (0.7.1) unstable; urgency=low++ * Add System.Process.Run, utilities and a monad for process progress+ output.+ * Rename ProcessOutput -> ProcessResult+ * Add a ProcessText class to characterize the type written to+ standard input and read from standard output and error.+ * Add an alias for readCreateProcess named readCreateProcessStrict+ * Update README.md++ -- David Fox <dsf@foxthompson.net> Mon, 05 Dec 2016 10:52:20 -0800+ haskell-process-extras (0.5) unstable; urgency=low * Have writeOutput return the input list rather than ()
process-extras.cabal view
@@ -1,5 +1,5 @@ Name: process-extras-Version: 0.7+Version: 0.7.1 Synopsis: Process extras Description: Extends <http://hackage.haskell.org/package/process>. Read process input and output as ByteStrings or
src/System/Process/Text.hs view
@@ -1,4 +1,4 @@-{-# LANGUAGE CPP, MultiParamTypeClasses #-}+{-# LANGUAGE CPP, FlexibleContexts, MultiParamTypeClasses #-} {-# OPTIONS_GHC -fno-warn-orphans #-} module System.Process.Text where