th-format-0.1.0.0: Template Haskell based support for format strings

Copyright(c) Moritz Clasmeier 2017-2018
LicenseBSD3
Maintainermtesseract@silverratio.net
Stabilityexperimental
PortabilityPOSIX
Safe HaskellNone
LanguageHaskell2010

Data.Format

Description

 

Synopsis

Documentation

fmt :: QuasiQuoter Source #

Quasi Quoter for format strings. Examples:

Examples:

>>> let answer = 42 in [fmt|What is the answer to universe, life and everything? It's $answer!|]
"What is the answer to universe, life and everything? It's 42!"
>>> let toggle = True in [fmt|The toggle is switched ${if toggle then ("on" :: Text) else "off"}|]
"The toggle is switched on"
>>> let timeDelta = 60 in [fmt|Request latency: ${timeDelta}ms|]
"Request latency: 60ms"

fmtConcat :: Monoid a => [a] -> a Source #

This is just mconcat, reexported under a specialized name in order to avoid namespace clashes.