The process-qq package

[Tags:bsd3, library]

Quasi-Quoters for exec process


[Skip to Readme]

Properties

Versions 0.2.0
Dependencies base (==4.*), bytestring (==0.9.*), enumerator (>=0.4.16 && <0.5), mtl (==2.0.*), process (==1.0.*), shakespeare-text (==0.10.*), template-haskell (>=2.4 && <2.7), text (==0.11.*) [details]
License BSD3
Copyright (c) 2011, Hideyuki Tanaka
Author Hideyuki Tanaka
Maintainer Hideyuki Tanaka <tanaka.hideyuki@gmail.com>
Stability Unknown
Category System
Home page http://github.com/tanakh/process-qq
Source repository head: git clone git://github.com/tanakh/process-qq.git
Uploaded Mon Dec 5 03:09:26 UTC 2011 by HideyukiTanaka
Distributions NixOS:0.2.0
Downloads 256 total (4 in the last 30 days)
Votes
0 []
Status Docs uploaded by user
Build status unknown [no reports yet]

Modules

[Index]

Downloads

Maintainer's Corner

For package maintainers and hackage trustees

Readme for process-qq

Readme for process-qq-0.2.0

process-qq: A Quasi-Quoter to execute processes

About

This is a simple package for executing external process using quasi-quoters.

Install

$ cabal update
$ cabal install process-qq

API

process-qq has three quasi-quoters, cmd, lcmd and enumCmd.

The result type of cmd is (Strict) ByteString, lcmd is Lazy ByteString, enumCmd's is MonadIO m => Enumerator ByteString m a.

Command is failed, an Exception is thrown.

Command is executed in run-time, not compile-time.

Example

  • Invoke a process simply
{-# LANGUAGE QuasiQuotes #-}
import System.Process.QQ

main = print =<< [cmd|ls|]
  • Enumerate a process
main =
  run_ $ [enumCmd|curl http://www.google.com/|] $$ iterHandle stdout
main = do
  [url] <- getArgs
  print =<< [cmd|curl #{url}|]