Copyright | (c) Moritz Clasmeier 2017-2018 |
---|---|
License | BSD3 |
Maintainer | mtesseract@silverratio.net |
Stability | experimental |
Portability | POSIX |
Safe Haskell | None |
Language | Haskell2010 |
- fmt :: QuasiQuoter
- fmtConcat :: Monoid a => [a] -> a
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"