process-conduit: Conduit for process

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

Conduit for process


[Skip to Readme]

Modules

[Index]

Flags

Automatic Flags
NameDescriptionDefault
examples

Build examples

Disabled

Use -f <flag> to enable a flag, or -f -<flag> to disable that flag. More info

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 && <0.10), conduit (>=0.2 && <0.3), mtl (>=2.0 && <2.1), process (>=1.0 && <1.2), process-conduit, shakespeare-text (>=0.10 && <0.11), template-haskell (>=2.4 && <2.8), text (>=0.11 && <0.12) [details]
License BSD-3-Clause
Copyright (c) 2011-2012, Hideyuki Tanaka
Author Hideyuki Tanaka
Maintainer Hideyuki Tanaka <tanaka.hideyuki@gmail.com>
Category System, Conduit
Home page http://github.com/tanakh/process-conduit
Source repo head: git clone git://github.com/tanakh/process-conduit.git
Uploaded by HideyukiTanaka at 2012-02-08T02:41:46Z
Distributions
Reverse Dependencies 7 direct, 78 indirect [details]
Executables process-qq, process-conduit
Downloads 22438 total (48 in the last 30 days)
Rating (no votes yet) [estimated by Bayesian average]
Your Rating
  • λ
  • λ
  • λ
Status Docs uploaded by user
Build status unknown [no reports yet]

Readme for process-conduit-0.0.3

[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 Source ByteString m ByteString and Conduit 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 qualified Data.Conduit as C
import qualified Data.Conduit.Binary as CB
import Data.Conduit.Process
import System.IO

main :: IO ()
main = C.runResourceT $ do
  sourceCmd "ls" C.$= conduitCmd "sort" C.$$ 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|] $$ sinkHandle stdout
main = do
  [url] <- getArgs
  print =<< [cmd|curl #{url}|]