@hackage process-conduit1.2.0.1
Conduits for processes (deprecated)
Categories
License
BSD-3-Clause
Maintainer
Michael Snoyman
Links
Versions
Deprecated
Dependencies (11)
- base >=4 && <5
- bytestring >=0.9
- conduit >=1.1
- control-monad-loop >=0.1 && <0.2
- mtl >=2.0
- process >=1.0 Show all…
Dependents (8)
@hackage/llvm-tools, @hackage/haskell-ftp, @hackage/acme-everything, @hackage/mighttpd2, @hackage/notmuch-web, @hackage/yesod-platform, Show all…
process-conduit: Conduit for processes
About
This package provides conduit for processes. Also this provides quasi-quoters for process using it.
Install
$ cabal update
$ cabal install process-conduit
Document
Haddock documents are here:
http://hackage.haskell.org/package/process-conduit
Quasi Quoters
process-conduit has three quasi-quoters, cmd, scmd and ccmd.
The result type of cmd is Lazy ByteString,
but execution will perform strictly.
The result type of scmd and ccmd are
GSource m ByteString and
GConduit ByteString m ByteString respectively.
If a command is failed, an exception is thrown.
Commands are executed in run-time, not compile-time.
Examples
- Create a Source and a Conduit of process
import Data.Conduit
import qualified Data.Conduit.Binary as CB
import Data.Conduit.Process
import System.IO
main :: IO ()
main = runResourceT $ do
sourceCmd "ls" $= conduitCmd "sort" $$ CB.sinkHandle stdout
- Invoke a process simply
{-# LANGUAGE QuasiQuotes #-}
import System.Process.QQ
main = print =<< [cmd|ls|]
- Conduit Quasi-Quoters
main :: IO ()
main = runResourceT $ do
[scmd|ls|] $= [ccmd|sort|] $$ CB.sinkHandle stdout
- Unquoting (syntax is same as shakespeare-text)
main = do
[url] <- getArgs
print =<< [cmd|curl #{url}|]