-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathPredef.hs
43 lines (31 loc) · 857 Bytes
/
Predef.hs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
-- | Some predefined quasiquoters
module System.Command.QQ.Predef where
import Language.Haskell.TH.Quote (QuasiQuoter)
import System.Command.QQ (interpreter, shell, quoter, callCommand)
-- | @bash@ shell
bash :: QuasiQuoter
bash = shell "bash"
-- | @zsh@ shell
zsh :: QuasiQuoter
zsh = shell "zsh"
-- | @awk@ interpreter
awk :: QuasiQuoter
awk = quoter (callCommand "awk" [])
-- | @ghci@ interpreter
ghci :: QuasiQuoter
ghci = quoter (callCommand "ghc" ["-ignore-dot-ghci", "-e"])
-- | @perl@ interpreter
perl :: QuasiQuoter
perl = interpreter "perl"
-- | @ruby@ interpreter
ruby :: QuasiQuoter
ruby = interpreter "ruby"
-- | @python@ interpreter
python :: QuasiQuoter
python = shell "python"
-- | @python2@ interpreter
python2 :: QuasiQuoter
python2 = shell "python2"
-- | @python3@ interpreter
python3 :: QuasiQuoter
python3 = shell "python3"