Safe Haskell | None |
---|---|
Language | Haskell2010 |
Data.Text.Format.Heavy.Types
Description
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
String format
Constructors
Format [FormatItem] |
class (Default f, Show f) => IsVarFormat f where Source #
Can be used for different data types describing formats of specific types.
Minimal complete definition
Instances
IsVarFormat () Source # | |
class Formatable a where Source #
Value that can be formatted to be substituted into format string.
Minimal complete definition
Methods
formatVar :: VarFormat -> a -> Either String Builder Source #
Format variable according to format specification. This function should usually parse format specification by itself.
Instances
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]
.
Constructors
Formatable a => Variable a |
Instances
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.
Minimal complete definition
Instances
Formatable a => VarContainer (Several a) Source # | |
Formatable a => VarContainer (Single a) Source # | |