The process-qq package

[Tags: bsd3, library]

Quasi-Quoters for exec process


[Skip to ReadMe]

Properties

Version0.2.0
Change logNone available
Dependenciesbase (==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]
LicenseBSD3
Copyright(c) 2011, Hideyuki Tanaka
AuthorHideyuki Tanaka
MaintainerHideyuki Tanaka <tanaka.hideyuki@gmail.com>
CategorySystem
Home pagehttp://github.com/tanakh/process-qq
Source repositoryhead: git clone git://github.com/tanakh/process-qq.git
UploadedMon Dec 5 03:09:26 UTC 2011 by HideyukiTanaka
Downloads196 total (10 in last 30 days)
Votes
0 []
StatusDocs uploaded by user
Build status unknown [no reports yet]

Modules

[Index]

Downloads

Maintainers' corner

For package maintainers and hackage trustees

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

{-# LANGUAGE QuasiQuotes #-}
import System.Process.QQ

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