HORIZON HASKELLDocslts/ghc-10.0.x77a86622026-10-31Search packagesCtrl K
Theme: |

GHC 10.0.0.20260917 · lts/ghc-10.0.x · 77a8662 · 2026-10-31

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"