Safe Haskell | None |
---|---|
Language | Haskell2010 |
A lot of quasiquoters to format and interpolate string expression
Synopsis
- fmt :: QuasiQuoter
- fmtTrim :: QuasiQuoter
- str :: QuasiQuoter
- strTrim :: QuasiQuoter
- raw :: QuasiQuoter
- module PyF.Class
- trimIndent :: String -> String
- mkFormatter :: String -> Config -> QuasiQuoter
- defaultConfig :: Config
- fmtConfig :: Config
- strConfig :: Config
- addTrim :: Config -> Config
- addFormatting :: (Char, Char) -> Config -> Config
Documentation
fmt :: QuasiQuoter Source #
Generic formatter, can format an expression to any t
as long as
t
is an instance of IsString
.
fmtTrim :: QuasiQuoter Source #
Format with whitespace trimming.
str :: QuasiQuoter Source #
multiline string, no interpolation.
strTrim :: QuasiQuoter Source #
multiline string, no interpolation, but does indentation trimming.
raw :: QuasiQuoter Source #
Raw string, no interpolation neither escaping is performed.
module PyF.Class
Whitespace utilities
trimIndent :: String -> String Source #
Removes the trailing whitespace of a string.
- First line is ignored if it only contains whitespaces
- All other line common indentation is removed, ignoring line with only whitespaces.
>>>
trimIndent "\n hello\n - a\n - b\n "
"hello\n- a\n- b\n"
See fmtTrim
for a quasiquoter with this behavior
Configuration
mkFormatter :: String -> Config -> QuasiQuoter Source #
defaultConfig :: Config Source #
This is an empty configuration. No formatting, no post processing
Configuration for str
it just wrap the multiline string with fromString
.