HORIZON HASKELLDocslts/ghc-10.0.x8fef28d2026-11-02Search packagesCtrl K
Theme: |

GHC 10.0.0.20260917 · lts/ghc-10.0.x · 8fef28d · 2026-11-02

Modulevulkan-utils-0.5.11.0Haskell2010

Vulkan.Utils.ShaderQQ.Interpolate

Synopsis
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"