process-qq: Quasi-Quoters for exec process

[ bsd3, library, system ] [ Propose Tags ] [ Report a vulnerability ]

Quasi-Quoters for exec process


[Skip to Readme]

Modules

[Index]

Downloads

Maintainer's Corner

Package maintainers

For package maintainers and hackage trustees

Candidates

  • No Candidates
Versions [RSS] 0.2.0
Dependencies base (>=4 && <5), bytestring (>=0.9 && <0.10), enumerator (>=0.4.16 && <0.5), mtl (>=2.0 && <2.1), process (>=1.0 && <1.1), shakespeare-text (>=0.10 && <0.11), template-haskell (>=2.4 && <2.7), text (>=0.11 && <0.12) [details]
License BSD-3-Clause
Copyright (c) 2011, Hideyuki Tanaka
Author Hideyuki Tanaka
Maintainer Hideyuki Tanaka <tanaka.hideyuki@gmail.com>
Category System
Home page http://github.com/tanakh/process-qq
Source repo head: git clone git://github.com/tanakh/process-qq.git
Uploaded by HideyukiTanaka at 2011-12-05T03:09:26Z
Distributions
Reverse Dependencies 1 direct, 0 indirect [details]
Downloads 1034 total (2 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-qq-0.2.0

[back to package description]

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}|]