{"action":"created","issue":{"url":"https://api.github.com/repos/elm-lang/elm-compiler/issues/905","labels_url":"https://api.github.com/repos/elm-lang/elm-compiler/issues/905/labels{/name}","comments_url":"https://api.github.com/repos/elm-lang/elm-compiler/issues/905/comments","events_url":"https://api.github.com/repos/elm-lang/elm-compiler/issues/905/events","html_url":"https://github.com/elm-lang/elm-compiler/issues/905","id":65246011,"number":905,"title":"String Interpolation Proposal","user":{"login":"rtfeldman","id":1094080,"avatar_url":"https://avatars.githubusercontent.com/u/1094080?v=3","gravatar_id":"","url":"https://api.github.com/users/rtfeldman","html_url":"https://github.com/rtfeldman","followers_url":"https://api.github.com/users/rtfeldman/followers","following_url":"https://api.github.com/users/rtfeldman/following{/other_user}","gists_url":"https://api.github.com/users/rtfeldman/gists{/gist_id}","starred_url":"https://api.github.com/users/rtfeldman/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/rtfeldman/subscriptions","organizations_url":"https://api.github.com/users/rtfeldman/orgs","repos_url":"https://api.github.com/users/rtfeldman/repos","events_url":"https://api.github.com/users/rtfeldman/events{/privacy}","received_events_url":"https://api.github.com/users/rtfeldman/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":26,"created_at":"2015-03-30T16:06:45Z","updated_at":"2015-04-02T18:32:56Z","closed_at":null,"body":"[String interpolation](http://en.wikipedia.org/wiki/String_interpolation) is incredibly desirable when building UIs. It would be great if Elm had it!\r\n\r\nThere are a bunch of [examples of how this is done in various languages](http://en.wikipedia.org/wiki/String_interpolation#Examples) on Wikipedia. Here are some different ways we could make the following Elm code more concise using String interpolation.\r\n\r\n(Note: I'm assuming `toString` is changed to be the identity function when given a String.)\r\n\r\n**[Elm](http://package.elm-lang.org/packages/elm-lang/core/1.1.1/String)**:\r\n```elm\r\n\"There are \" ++ (toString (length hobbitList)) ++ \" hobbits.\"\r\n```\r\n\r\n**[Mustache](https://mustache.github.io/mustache.5.html)/[Handlebars](http://handlebarsjs.com/)**:\r\n```handlebars\r\n\"There are {{length hobbitList}} hobbits.\"\r\n```\r\n\r\n**[Ruby](https://rubymonk.com/learning/books/1-ruby-primer/chapters/5-strings/lessons/31-string-basics)/[CoffeeScript](http://coffeescript.org/#strings)/[Elixir](http://elixir-lang.org/getting-started/basic-types.html#strings):**\r\n```ruby\r\n\"There are #{length hobbitList} hobbits.\"\r\n```\r\n\r\n**[Perl](http://perlmaven.com/quoted-interpolated-and-escaped-strings-in-perl)/[PHP](http://php.net/manual/en/language.types.string.php#language.types.string.parsing.simple)/[Dart](https://www.dartlang.org/docs/dart-up-and-running/ch02.html)/[Haxe](http://haxe.org/manual/lf-string-interpolation.html)/[ES6 JavaScript](http://updates.html5rocks.com/2015/01/ES6-Template-Strings)**:\r\n```dart\r\n\"There are ${length hobbitList} hobbits.\"\r\n```\r\n\r\n**[Swift](https://developer.apple.com/library/ios/documentation/Swift/Conceptual/Swift_Programming_Language/StringsAndCharacters.html#//apple_ref/doc/uid/TP40014097-CH7-ID292)**:\r\n```swift\r\n\"There are \\(length hobbitList) hobbits.\"\r\n```\r\n\r\n**[Boo](http://boo.codehaus.org/String+Interpolation)**:\r\n```boo\r\n\"There are $(length hobbitList) hobbits.\"\r\n```\r\n\r\n**[Scala](http://docs.scala-lang.org/overviews/core/string-interpolation.html):**\r\n```scala\r\ns\"There are ${length hobbitList} hobbits.\"\r\n```\r\n\r\n**[C#](https://roslyn.codeplex.com/discussions/570614):**\r\n```c#\r\n$\"There are {length hobbitList} hobbits.\"\r\n```"},"comment":{"url":"https://api.github.com/repos/elm-lang/elm-compiler/issues/comments/89003442","html_url":"https://github.com/elm-lang/elm-compiler/issues/905#issuecomment-89003442","issue_url":"https://api.github.com/repos/elm-lang/elm-compiler/issues/905","id":89003442,"user":{"login":"evancz","id":1658058,"avatar_url":"https://avatars.githubusercontent.com/u/1658058?v=3","gravatar_id":"","url":"https://api.github.com/users/evancz","html_url":"https://github.com/evancz","followers_url":"https://api.github.com/users/evancz/followers","following_url":"https://api.github.com/users/evancz/following{/other_user}","gists_url":"https://api.github.com/users/evancz/gists{/gist_id}","starred_url":"https://api.github.com/users/evancz/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/evancz/subscriptions","organizations_url":"https://api.github.com/users/evancz/orgs","repos_url":"https://api.github.com/users/evancz/repos","events_url":"https://api.github.com/users/evancz/events{/privacy}","received_events_url":"https://api.github.com/users/evancz/received_events","type":"User","site_admin":false},"created_at":"2015-04-02T18:32:55Z","updated_at":"2015-04-02T18:32:55Z","body":"Let's advocate for or against! :P\r\n\r\nI think it's a bit weird to use `'c'` for characters and `'''hello'''` for strings. Seems very inconsistent to me. I'd go for something like this:\r\n\r\n`\"There are {{length hobbitList}} hobbits.\"` - interpolated\r\n`\"\"\"There are {{length hobbitList}} hobbits.\"\"\"` - interpolated\r\n`'\"\"\"There are \\{{length hobbitList}} hobbits.\"\"` - NOT interpolated\r\n\r\nYou can just \"escape\" a curly brace and it won't count anymore."}}