@hackage command-qq0.1.0.0

Quasiquoters for external commands

Features:

  • Quasiquotation syntax for external commands:

[sh| echo hello world! |]
  • Easy way to define custom quasiquoters (see examples/CustomQQ.hs)

ghci = QQ.quoter $ QQ.callCommand "ghc" ["-ignore-dot-ghci", "-e"]
  • Can embed Haskell variables in scripts

class Embed a where
  embed :: a -> String

instance Embed String
  embed = id

main :: IO ()
main = let excl = replicate 3 '!' in -- I'd love to show an example but haddock markup fails here
  • Can embed quasiquoters in DSLs (see examples/CommandT.hs)

class Eval r where
  eval :: String -> [String] -> r

instance Eval (IO ExitCode) where
  eval command args = System.Process.rawSystem command args