@hackage process-qq0.2.0

Quasi-Quoters for exec process

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