Skip to content

Commit 2d67b73

Browse files
committed
#6: added explanation to the docs
1 parent 1082b7e commit 2d67b73

File tree

1 file changed

+51
-0
lines changed
  • src/Text/InterpolatedString

1 file changed

+51
-0
lines changed

src/Text/InterpolatedString/QM.hs

Lines changed: 51 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -68,6 +68,18 @@ qn = QuasiQuoter Parsers.qn
6868
-- baz |] -- "foo\\nbar\\nbaz"
6969
-- @
7070
--
71+
-- Keep in mind that this example:
72+
--
73+
-- @
74+
-- ['qmb'|
75+
-- foo
76+
-- bar
77+
-- |]
78+
-- @
79+
--
80+
-- Won't produce @"foo\\nbar\\n"@ nor @"\\nfor\\nbar\\n"@ but @"foo\\nbar"@, it
81+
-- means it separates "between" the lines not by edges.
82+
--
7183
qmb :: QuasiQuoter
7284
qmb = QuasiQuoter Parsers.qmb
7385
(error "Cannot use 'qmb' as a pattern")
@@ -83,6 +95,19 @@ qmb = QuasiQuoter Parsers.qmb
8395
-- {'b':'a':'r':""}
8496
-- baz |] -- "foo\\n{'b':'a':'r':\\"\\"}\\nbaz"
8597
-- @
98+
--
99+
-- Keep in mind that this example:
100+
--
101+
-- @
102+
-- ['qnb'|
103+
-- foo
104+
-- bar
105+
-- |]
106+
-- @
107+
--
108+
-- Won't produce @"foo\\nbar\\n"@ nor @"\\nfor\\nbar\\n"@ but @"foo\\nbar"@, it
109+
-- means it separates "between" the lines not by edges.
110+
--
86111
qnb :: QuasiQuoter
87112
qnb = QuasiQuoter Parsers.qnb
88113
(error "Cannot use 'qnb' as a pattern")
@@ -97,6 +122,19 @@ qnb = QuasiQuoter Parsers.qnb
97122
-- {'b':'a':'r':""}
98123
-- baz |] -- "foo bar baz"
99124
-- @
125+
--
126+
-- Keep in mind that this example:
127+
--
128+
-- @
129+
-- ['qms'|
130+
-- foo
131+
-- bar
132+
-- |]
133+
-- @
134+
--
135+
-- Won't produce @"foo bar "@ nor @" for bar "@ but @"foo bar"@, it
136+
-- means it separates "between" the lines not by edges.
137+
--
100138
qms :: QuasiQuoter
101139
qms = QuasiQuoter Parsers.qms
102140
(error "Cannot use 'qms' as a pattern")
@@ -113,6 +151,19 @@ qms = QuasiQuoter Parsers.qms
113151
-- {'b':'a':'r':""}
114152
-- baz |] -- "foo {'b':'a':'r':\\"\\"} baz"
115153
-- @
154+
--
155+
-- Keep in mind that this example:
156+
--
157+
-- @
158+
-- ['qns'|
159+
-- foo
160+
-- bar
161+
-- |]
162+
-- @
163+
--
164+
-- Won't produce @"foo bar "@ nor @" for bar "@ but @"foo bar"@, it
165+
-- means it separates "between" the lines not by edges.
166+
--
116167
qns :: QuasiQuoter
117168
qns = QuasiQuoter Parsers.qns
118169
(error "Cannot use 'qns' as a pattern")

0 commit comments

Comments
 (0)