@hackage command-qq0.1.0.0
Quasiquoters for external commands
Categories
License
BSD-3-Clause
Maintainer
matvey.aksenov@gmail.com
Links
Versions
Installation
Dependencies (4)
- base >=4 && <5
- process
- template-haskell
- unix Show all…
Dependents (3)
@hackage/acme-everything, @hackage/coformat, @hackage/directory-layout
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