Safe Haskell | None |
---|---|
Language | Haskell2010 |
placeholder syntax:
index based
{ Int }
key based
{
String
|ByteString
|Text
}
other placeholders may be implemented with
Text.Regex.Do.Pcre.Ascii.Replace or Text.Regex.Do.Pcre.Utf8.Replace
- class Format a arg where
- format :: a -> arg -> a
- class ReplaceOne idx a where
- replaceOne :: a -> idx -> a -> a
- type Formatable a = (Format a [a], Format a [(a, a)])
Documentation
class Format a arg where Source
implemented a:
:: a | text to format e.g. "today is {0}" |
-> arg | replacement: [a] or [(a,a)] |
-> a | formatted text |
ReplaceOne a a => Format a [(a, a)] Source | key basedkey may be {any a}
"овчинка выделки не стоит" |
ReplaceOne Int a => Format a [a] Source | index based
"на первое перловка, на второе перловка"
"Polly got a cracker" |
class ReplaceOne idx a where Source
replaceOne :: a -> idx -> a -> a Source
type Formatable a = (Format a [a], Format a [(a, a)]) Source