I'm curious if there are other options for making long inline strings look
good in Elm:

1. Use double quotes and (++) to concatenate. Cons: adds runtime operation;
must add parens around the string block if it's an argument, e.g. the
following does not compile

```elm
        |> Dict.insert 2
            (Story
                "John Oliver"
                "Far, far away in a land called teevee, there " ++
                "lived a wise man whose laugh you could see."
            )
```

To compile, it must become:

```elm
        |> Dict.insert 2
            (Story
                "John Oliver"
                ("Far, far away in a land called teevee, there "
                    ++ "lived a wise man whose laugh you could see."
                )
            )
```

2. Use triple-double quotes. Cons: includes whitespace, and in combination
with elm-format, whitespace is not within control:

```elm
        |> Dict.insert 2
            (Story
                "John Oliver"
                """Far, far away in a land called teevee, there
                lived a wise man whose laugh you could see."""
            )
```

The second string becomes "Far, far away in a land called teevee, there
           lived a wise man whose laugh you could see." (Note extra spaces
between "there" and "lived").

3. Put strings on one big line. Cons: not pretty, hard to see in a text
editor without line wrapping.

Any suggestions?

Thanks,
Duane

-- 
You received this message because you are subscribed to the Google Groups "Elm 
Discuss" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to elm-discuss+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to