I agree that backslash string wrapping is obscure.<div>I do use it a lot, but I would not be sad to see it go.</div><div><br></div><div>The same is true for \a, \b, \f, \v, \EM, \DC1, etc.</div><div>We do need \&amp;, though.<br>
<br><div class="gmail_quote">On Tue, Oct 2, 2012 at 10:17 PM, Evan Laforge <span dir="ltr">&lt;<a href="mailto:qdunkan@gmail.com" target="_blank">qdunkan@gmail.com</a>&gt;</span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
The backslash string wrapping feature is a fairly obscure part of<br>
haskell syntax, and some tools don&#39;t handle it properly (e.g. the<br>
built in &#39;lex&#39; function won&#39;t lex such strings properly).  It&#39;s also<br>
not as useful as e.g. python&#39;s triple quotes, because you have to<br>
suffix and prefix every line with a backslash.  As long as you are<br>
have to add suffixes and prefixes (i.e. straight cut and paste no<br>
longer works), you might as well write it out with (++).  In other<br>
words, as long as you&#39;re applying (&#39;\\&#39;:) . (++&quot;\\&quot;) you might as well<br>
apply (&quot;++ \&quot;&quot;++) . (++&quot;\&quot;&quot;).  And it seems to me that &quot;string<br>
literal&quot; ++ &quot;another string&quot; is an easy thing for a compiler to<br>
optimize, ghc-core says ghc unsurprisingly has no trouble with it.<br>
<br>
So it&#39;s probably not helpful for performance.  IMO it&#39;s not very<br>
useful for it&#39;s intended purpose (embedding multiline strings) because<br>
of the \s everywhere.  It doesn&#39;t seem very widely used, and it adds a<br>
little bit of a hassle to parsing.  And &#39;lex&#39; doesn&#39;t support it.<br>
<br>
Any interest in getting rid of it?<br>
<br>
<br>
I would actually be in favor of triple quotes (yeah, I know it can be<br>
done with quasi-quotes, but still...), but that&#39;s a different issue.<br>
<br>
Also, it&#39;s hardly a big deal, but do we really need \a, \b, \f, and<br>
\v?  The one time I used one (it was \v) it was a typo and I would<br>
have preferred the parse error, instead I got weird output that I<br>
didn&#39;t notice for a long time.  If I really want to, say, ring the<br>
terminal bell or do a vertical tab or perhaps send a telegraph, I<br>
would be using some library that handles terminal type stuff in a<br>
higher level way.  Similarly, the \EM, \DC1, etc. codes are probably<br>
not pulling their weight.  The &#39;70s were 40 years ago!  And there&#39;s<br>
that weird \&amp; thing.  Surely cursor control library authors have<br>
better ways to construct their magic codes.<br>
<br>
_______________________________________________<br>
Haskell-prime mailing list<br>
<a href="mailto:Haskell-prime@haskell.org">Haskell-prime@haskell.org</a><br>
<a href="http://www.haskell.org/mailman/listinfo/haskell-prime" target="_blank">http://www.haskell.org/mailman/listinfo/haskell-prime</a><br>
</blockquote></div><br></div>