Safe Haskell | None |
---|---|
Language | Haskell2010 |
formerly Format
substitutes placeholder values with values from args
in lieu of format function there are 2 operators: <
and >
: no need to remember arg order.
placeholder syntax:
index based
{ Int }
key based
{
String
|ByteString
|Text
}
other placeholders may be implemented with
Text.Regex.Do.Replace.Latin or Text.Regex.Do.Replace.Utf8
to avoid clash with Prelude
:
import Prelude hiding((<),(>))
or qualify <
with alias e.g. (assuming this module is imported with F alias):
F.<
- class Template a repl where
- class ReplaceOne idx a
- type Formatable a = (Template a [a], Template a [(a, a)])
Documentation
class Template a repl where Source #
ReplaceOne a a => Template a [(a, a)] Source # | key basedkey may be {any a}
"овчинка выделки не стоит" |
ReplaceOne Int a => Template a [a] Source # | index based
"даме цветы, детям мороженое"
"Polly wants a cracker"
"на первое перловка, на второе перловка" |
class ReplaceOne idx a Source #
replaceOne
type Formatable a = (Template a [a], Template a [(a, a)]) Source #