HORIZON HASKELLDocslts/ghc-9.14.x3e2d5682026-10-11Search names, modules, packages, or :: a typeCtrl K

GHC 9.14.1 · lts/ghc-9.14.x · 3e2d568 · 2026-10-11

Modulevulkan-utils-0.5.11.0Haskell2010

Vulkan.Utils.ShaderQQ.Interpolate

  • 1 value
valueinterpExp :: String -> Q Exp
#

interpExp performs very simple interpolation of Haskell values into Strings.

  • Interpolated variables are prefixed with $

  • They can optionally be surrounded with braces like ${foo}

  • Interpolated variables are converted to strings with show

  • To escape a $ use \$

Example1 expression
let foo = 123 in $(interpExp "hello, $foo")"hello, 123"
Example1 expression
let foo = "world" in $(interpExp "hello, \\$foo")"hello, $foo"
Example1 expression
let foo = "world" in $(interpExp "hello\r\n\rworld")"hello\r\n\rworld"