GHC String interpolation
summary
A GHC proposal (opened in 2023) adds native string interpolation with an S"..." syntax that desugars to an interpolate class and builder-style combinators; a local build compiles and demos show ${expr} inlines (including nested expressions), a SQL-qualified interpolator that parameterizes values to prevent injection, and a source-loc interpolator. Benchmarks show plain String interpolation matches naive concatenation while Text is 13× slower unless using qualified strings plus rewrite rules to regain naïve performance. The design evolves after 3 years and 635 comments.
AI-written summary · about
chapters (15)
- 0:00GHC string interpolation intro
- 1:30String interpolation need
- 2:35Live demo
- 6:47Interpolate type class
- 9:13Desugaring and performance
- 13:45Feature status and limits
- 14:45Qualified strings extension
- 16:51Interpolate empty necessity
- 19:16Custom interpolators
- 21:24Benchmark results
- 24:54Three-year proposal reflections
- 29:05Community feedback debates
- 30:09GitHub discussions challenges
- 35:10Open discussion and audience questions
- 45:21Closing thoughts








