Safe Haskell | None |
---|---|
Language | Haskell2010 |
This module contains basic type definitions
- type VarName = Text
- type VarFormat = Maybe Text
- data FormatItem
- data Format = Format [FormatItem]
- class (Default f, Show f) => IsVarFormat f where
- class Formatable a where
- data Variable = Formatable a => Variable a
- formatAnyVar :: VarFormat -> Variable -> Either String Builder
- class VarContainer c where
Documentation
data FormatItem Source #
String format item.
class (Default f, Show f) => IsVarFormat f where Source #
Can be used for different data types describing formats of specific types.
IsVarFormat () Source # | |
class Formatable a where Source #
Value that can be formatted to be substituted into format string.
formatVar :: VarFormat -> a -> Either String Builder Source #
Format variable according to format specification. This function should usually parse format specification by itself.
Formatable Variable Source # | |
Show a => Formatable (Shown a) Source # | |
Formatable a => Formatable (Single a) Source # | |
Any variable that can be substituted.
This type may be also used to construct heterogeneous lists:
[Variable 1, Variable "x"] :: [Variable]
.
Formatable a => Variable a |
formatAnyVar :: VarFormat -> Variable -> Either String Builder Source #
Format one variable according to format specification.
class VarContainer c where Source #
Data structure that contains some number of variables.
VarContainer DefaultValue Source # | |
Formatable a => VarContainer (Several a) Source # | |
Formatable a => VarContainer (Single a) Source # | |
(VarContainer c1, VarContainer c2) => VarContainer (ThenCheck c1 c2) Source # | |