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

GHC 10.0.0.20260917 · lts/ghc-10.0.x · 8174fa4 · 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"