summaryrefslogtreecommitdiff
path: root/standalone/android/haskell-patches/shakespeare-text_remove-TH.patch
blob: ece906f4b6c053311e188f6b58de3ba98a6139a6 (plain)
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
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
From dca2a30ca06865bf66cd25cc14b06f5d28190231 Mon Sep 17 00:00:00 2001
From: dummy <dummy@example.com>
Date: Thu, 16 Oct 2014 02:46:57 +0000
Subject: [PATCH] remove TH

---
 Text/Shakespeare/Text.hs | 125 +++++------------------------------------------
 1 file changed, 11 insertions(+), 114 deletions(-)

diff --git a/Text/Shakespeare/Text.hs b/Text/Shakespeare/Text.hs
index 6865a5a..e25a8be 100644
--- a/Text/Shakespeare/Text.hs
+++ b/Text/Shakespeare/Text.hs
@@ -7,18 +7,18 @@ module Text.Shakespeare.Text
     ( TextUrl
     , ToText (..)
     , renderTextUrl
-    , stext
-    , text
-    , textFile
-    , textFileDebug
-    , textFileReload
-    , st -- | strict text
-    , lt -- | lazy text, same as stext :)
+    --, stext
+    --, text
+    --, textFile
+    --, textFileDebug
+    --, textFileReload
+    --, st -- | strict text
+    --, lt -- | lazy text, same as stext :)
     -- * Yesod code generation
-    , codegen
-    , codegenSt
-    , codegenFile
-    , codegenFileReload
+    --, codegen
+    --, codegenSt
+    --, codegenFile
+    --, codegenFileReload
     ) where
 
 import Language.Haskell.TH.Quote (QuasiQuoter (..))
@@ -45,106 +45,3 @@ instance ToText Int32 where toText = toText . show
 instance ToText Int64 where toText = toText . show
 instance ToText Int   where toText = toText . show
 
-settings :: Q ShakespeareSettings
-settings = do
-  toTExp <- [|toText|]
-  wrapExp <- [|id|]
-  unWrapExp <- [|id|]
-  return $ defaultShakespeareSettings { toBuilder = toTExp
-  , wrap = wrapExp
-  , unwrap = unWrapExp
-  }
-
-
-stext, lt, st, text :: QuasiQuoter
-stext = 
-  QuasiQuoter { quoteExp = \s -> do
-    rs <- settings
-    render <- [|toLazyText|]
-    rendered <- shakespeareFromString rs { justVarInterpolation = True } s
-    return (render `AppE` rendered)
-    }
-lt = stext
-
-st = 
-  QuasiQuoter { quoteExp = \s -> do
-    rs <- settings
-    render <- [|TL.toStrict . toLazyText|]
-    rendered <- shakespeareFromString rs { justVarInterpolation = True } s
-    return (render `AppE` rendered)
-    }
-
-text = QuasiQuoter { quoteExp = \s -> do
-    rs <- settings
-    quoteExp (shakespeare rs) $ filter (/='\r') s
-    }
-
-
-textFile :: FilePath -> Q Exp
-textFile fp = do
-    rs <- settings
-    shakespeareFile rs fp
-
-
-textFileDebug :: FilePath -> Q Exp
-textFileDebug = textFileReload
-{-# DEPRECATED textFileDebug "Please use textFileReload instead" #-}
-
-textFileReload :: FilePath -> Q Exp
-textFileReload fp = do
-    rs <- settings
-    shakespeareFileReload rs fp
-
--- | codegen is designed for generating Yesod code, including templates
--- So it uses different interpolation characters that won't clash with templates.
-codegenSettings :: Q ShakespeareSettings
-codegenSettings = do
-  toTExp <- [|toText|]
-  wrapExp <- [|id|]
-  unWrapExp <- [|id|]
-  return $ defaultShakespeareSettings { toBuilder = toTExp
-  , wrap = wrapExp
-  , unwrap = unWrapExp
-  , varChar = '~'
-  , urlChar = '*'
-  , intChar = '&'
-  , justVarInterpolation = True -- always!
-  }
-
--- | codegen is designed for generating Yesod code, including templates
--- So it uses different interpolation characters that won't clash with templates.
--- You can use the normal text quasiquoters to generate code
-codegen :: QuasiQuoter
-codegen =
-  QuasiQuoter { quoteExp = \s -> do
-    rs <- codegenSettings
-    render <- [|toLazyText|]
-    rendered <- shakespeareFromString rs { justVarInterpolation = True } s
-    return (render `AppE` rendered)
-    }
-
--- | Generates strict Text
--- codegen is designed for generating Yesod code, including templates
--- So it uses different interpolation characters that won't clash with templates.
-codegenSt :: QuasiQuoter
-codegenSt =
-  QuasiQuoter { quoteExp = \s -> do
-    rs <- codegenSettings
-    render <- [|TL.toStrict . toLazyText|]
-    rendered <- shakespeareFromString rs { justVarInterpolation = True } s
-    return (render `AppE` rendered)
-    }
-
-codegenFileReload :: FilePath -> Q Exp
-codegenFileReload fp = do
-    rs <- codegenSettings
-    render <- [|TL.toStrict . toLazyText|]
-    rendered <- shakespeareFileReload rs{ justVarInterpolation = True } fp
-    return (render `AppE` rendered)
-
-codegenFile :: FilePath -> Q Exp
-codegenFile fp = do
-    rs <- codegenSettings
-    render <- [|TL.toStrict . toLazyText|]
-    rendered <- shakespeareFile rs{ justVarInterpolation = True } fp
-    return (render `AppE` rendered)
-- 
2.1.1