process-conduit: Conduits for processes (deprecated)

[ bsd3, conduit, deprecated, library, system ] [ Propose Tags ] [ Report a vulnerability ]
Deprecated in favor of conduit-extra

This package is deprecated. Please use Data.Conduit.Process from conduit-extra instead. The original code is maintained in Data.Conduit.ProcessOld for those wishing to use the older API.


[Skip to Readme]

Modules

[Index]

Downloads

Maintainer's Corner

Package maintainers

For package maintainers and hackage trustees

Candidates

  • No Candidates
Versions [RSS] 0.0.0, 0.0.1, 0.0.2, 0.0.3, 0.0.4, 0.1.0, 0.4.0, 0.4.1, 0.5.0, 0.5.0.1, 0.5.0.2, 0.5.0.3, 0.5.0.4, 0.5.0.5, 1.0.0.0, 1.0.0.1, 1.0.0.2, 1.0.0.3, 1.1.0.0, 1.2.0.0, 1.2.0.1
Dependencies base (>=4 && <5), bytestring (>=0.9), conduit (>=1.1), control-monad-loop (>=0.1 && <0.2), mtl (>=2.0), process (>=1.0), resourcet (>=1.1), shakespeare, shakespeare-text (>=1.0), template-haskell (>=2.4), text (>=0.11) [details]
License BSD-3-Clause
Copyright (c) 2011-2013, Hideyuki Tanaka
Author Hideyuki Tanaka
Maintainer Michael Snoyman
Category System, Conduit
Home page http://github.com/snoyberg/process-conduit
Source repo head: git clone git://github.com/snoyberg/process-conduit.git
Uploaded by MichaelSnoyman at 2014-07-17T15:53:31Z
Distributions
Reverse Dependencies 7 direct, 78 indirect [details]
Downloads 22684 total (46 in the last 30 days)
Rating (no votes yet) [estimated by Bayesian average]
Your Rating
  • λ
  • λ
  • λ
Status Docs available [build log]
Successful builds reported [all 1 reports]

Readme for process-conduit-1.2.0.1

[back to package description]

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
main = do
  [url] <- getArgs
  print =<< [cmd|curl #{url}|]