backslashes within quotes

Evan Laforge qdunkan at gmail.com
Fri Oct 5 21:34:12 CEST 2012


On Fri, Oct 5, 2012 at 8:01 AM, Lennart Augustsson
<lennart at augustsson.net> wrote:
> I agree that backslash string wrapping is obscure.
> I do use it a lot, but I would not be sad to see it go.

On Fri, Oct 5, 2012 at 9:50 AM, Henrik Nilsson
<Henrik.Nilsson at nottingham.ac.uk> wrote:
> I find it quite neat, also use it a lot, and would be sad
> to see it go.
>
> It is also a good feature for automatic formatting of code to
> a specific width.

But what about just replacing those \s with ++?  It's true it's a few
more characters, but is it really that much more work?  I actually
just used the \s recently, and being 3 characters shorter is a bit
nicer, but not that much nicer.  And it messed up my simplistic syntax
highlighting.

However, I did notice that given OverloadedStrings, '"hello " <>
"there" :: Text' does not get optimized to 'Text.pack "hello there"',
but for all I know the complicated thing it emits is just as
efficient.

> The same is true for \a, \b, \f, \v, \EM, \DC1, etc.
> We do need \&, though.

What is \& used for?  I never knew it existed until I reread that bit
of the report, and couldn't figure out what it was for.

I'm assuming that only terminal manipulation stuff needs those things,
and that you would generally not want to write it inline, but write
something like
'ringyDingy "I'm going to nag and bell at you!"', and ringyDingy is
just as happy to build the bell with Char.chr.


I guess this is pretty much bike-sheddery so I'll leave it at this,
but it seems like the darker corners should be subject to some spring
cleaning every 10 years or so...



More information about the Haskell-prime mailing list