Moduleshakespeare-2.1.0.1Haskell2010
Text.Shakespeare.Text
A Shakespearean module for general text processing, introducing type-safe, compile-time variable interpolation.
Text templates use the same parser as for other shakespearean templates
which enables variable interpolation using #{..}. The parser also
recognize the @{..} and ^{..} syntax.
If it is necessary that your template produces the output containing one of the interpolation syntax you can escape the sequence using a backslash:
λ> :set -XQuasiQuotes
λ> let bar = 23 :: Int in [st|#{bar}|] :: Textproduces "23", but
λ> let bar = 23 :: Int in [st|#\{bar}|] :: Textreturns "#{bar}". The escaping backslash is removed from the output.
Further reading: Shakespearean templates: https://www.yesodweb.com/book/shakespearean-templates
- 1 type
- 1 class
- 15 values
- Packageshakespeare-2.1.0.1
- Exports17
- LanguageHaskell2010
- LicenceMIT
- SourceText.hs
Instances7ToText, …
ToText Int32Defined in shakespeare-2.1.0.1 · Text.Shakespeare.TextToText Int64Defined in shakespeare-2.1.0.1 · Text.Shakespeare.TextToText IntDefined in shakespeare-2.1.0.1 · Text.Shakespeare.TextToText TextDefined in shakespeare-2.1.0.1 · Text.Shakespeare.TextToText BuilderDefined in shakespeare-2.1.0.1 · Text.Shakespeare.TextToText TextDefined in shakespeare-2.1.0.1 · Text.Shakespeare.TextToText [Char]Defined in shakespeare-2.1.0.1 · Text.Shakespeare.Text
Like stext, but reads an external file at compile-time.
Deprecated. Please use textFileReload instead
strict text
lazy text, same as stext :)
strict text whose left edge is aligned with bar (|)
lazy text, whose left edge is aligned with bar (|)
* Yesod code generation
codegen is designed for generating Yesod code, including templates So it uses different interpolation characters that won't clash with templates. You can use the normal text quasiquoters to generate code
Generates strict Text codegen is designed for generating Yesod code, including templates So it uses different interpolation characters that won't clash with templates.