{
"$type": "site.standard.document",
"bskyPostRef": {
"cid": "bafyreihqyqn2nwfta26s6nkm6kwrtg3u7by6qjwf3yjsg5fcnzalyzhy34",
"uri": "at://did:plc:pi6woz4d47bkuws673w2il2r/app.bsky.feed.post/3mo43uuw5spq2"
},
"path": "/t/final-call-for-ghc-string-interpolation-proposal/14234#post_18",
"publishedAt": "2026-06-12T14:22:58.000Z",
"site": "https://discourse.haskell.org",
"textContent": "Ideally, text would have the following support:\n\n * Normal `s\"...\"` with overloaded strings (uses default Interpolate class, concats with String, final fromString)\n * `Basic.s\"...\"` an interpolator shipped from GHC that doesnt do any implicit interpolation, just concats\n * `Data.Text.s\"...\"` would use the default Interpolate class that concats with Text and rewrite rules for performance\n * Same for LazyText and Builder\n\n\n\nThe first two bullets are free, text gets it out of the box. The third bullet needs to be implemented by text. Text could also choose to implement other interpolators if it wants, e.g. an interpolator using its own `TextInterpolate` class. But `TextInterpolate` should be unnecessary; my benchmark shows that rewrite rules with the default Interpolate class is equally performant.\n\nIf it’s not clear what the difference between the first and third bullet is, it’s essentially the difference between\n\n\n Text.pack (\"age: \" <> show age)\n\n Text.pack \"age: \" <> (Text.pack . show) age\n",
"title": "Final call for GHC String Interpolation proposal!"
}