Open reuleaux opened 6 years ago
Special behavior of backslashes is not even documented in https://hackage.haskell.org/package/interpolate-0.2.0/docs/Data-String-Interpolate.html . Please, at least document it
Just to add an edge case here that bit me: these two values have the same result in the i
quoter:
> putStrLn [i|print("hi")|]
print("hi")
> putStrLn [i|print(\"hi\")|]
print("hi")
I was not expecting this, since I was trying to produce a string that actually has literal backslashes in it. It turns out using two produces that result:
> putStrLn [i|print(\\"hi\\")|]
print(\"hi\")
Very confusing :)
this is for the wishlist: In general I like your interpolate package , its parameter feature for example:
[i| ... #{param} ... ]
, or the possibility to use String and Text types.There are times however when I have to resort to the simpler (String only)
Text.RawString.QQ
(pkg raw-strings-qq), which does not offer parameters, when I am assembling some latex code snippets for example, I usefor backslash serves as an escape in your i quoter, and I don't want to write double backslashes with your i quoter
using just a single backslash with the r quoter, I can cut & past my latex snippets for example.
I wish your Interpolate package would offer a second quoter, that does NOT treat the backslash any special, but otherwise offers all of your package's advantages. thanks.