yasi-0.0.0.0: Yet another string interpolator
Safe HaskellNone
LanguageHaskell2010

Yasi

Description

Yet another string interpolator

Synopsis

Documentation

i :: QuasiQuoter Source #

The interpolator, intended to be used with QuasiQuotes.

>>> :set -XQuasiQuotes
>>> (foo, bar) = ("yet another ", "interpolator")
>>> [i|${foo}string $bar|] :: String
"yet another string interpolator"

You can also use ${} to create a function interpolator (this "abstraction" feature is inspired by interpolate):

>>> [i|more ${}${} code|] "point" "free" :: Text
"more pointfree code"

To use show to interpolate a value:

>>> let x = 1 + 1 in [i|1 + 1 = ${show x}|] :: ByteString
"1 + 1 = 2"