nyan-interpolation-core-0.9.2: Customize your nyan interpolator!
Safe HaskellSafe-Inferred
LanguageHaskell2010

Text.Interpolation.Nyan.Core.Internal.Splice

Description

Producing TH splices for interpolation.

Synopsis

Documentation

intSplice :: InterpolatorOptions -> (SwitchesOptions, InterpolatedString) -> ExpQ Source #

Build interpolated string into TH splice.

simpleValueInterpolator :: ValueInterpolator Source #

Interpolates only strings containing single variable.

This allows for {var}-like interpolated values, no applications, operators or other constructions are allowed.

tickedValueInterpolator :: ValueInterpolator Source #

This is a variation of simpleValueInterpolator that requires all the referred variables to start from a special i' prefix.

One major issue with simpleValueInterpolator is that, with it the user can mistakenly pick a value from the wrong scope, for instance, a global value instead of a local one. This value interpolator tries to solve the issue by bringing the practice to call the interpolator like

let renderedText =
      let i'value1 = ...
          i'value2 = ...
      in [int||Values are {value1} and {value2}]

and so interpolating only local declarations.

simpleInvisibleCharsPreview :: InvisibleCharsPreview Source #

Marks the most common space-like characters.