Quasi-Quoters for exec process

Latest on Hackage:0.2.0

This package is not currently in any snapshots. If you're interested in using it, we recommend adding it to Stackage Nightly. Doing so will make builds more reliable, and allow to host generated Haddocks.

BSD3 licensed by Hideyuki Tanaka
Maintained by Hideyuki Tanaka

process-qq: A Quasi-Quoter to execute processes


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


$ cabal update
$ cabal install process-qq


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.


  • Invoke a process simply

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

main = print =<< [cmd|ls|]
  • Enumerate a process

main =
  run_ $ [enumCmd|curl|] $$ iterHandle stdout
main = do
  [url] <- getArgs
  print =<< [cmd|curl #{url}|]
comments powered byDisqus