Safe Haskell | Safe |
---|---|
Language | Haskell2010 |
This module contains basic type definitions
Synopsis
- type VarName = Text
- type VarFormat = Maybe Text
- data FormatItem
- data Format = Format [FormatItem]
- appendFormat :: Format -> Format -> Format
- 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
- class VarContainer c => ClosedVarContainer c where
Documentation
data FormatItem Source #
String format item.
Instances
Eq FormatItem Source # | |
Defined in Data.Text.Format.Heavy.Types (==) :: FormatItem -> FormatItem -> Bool # (/=) :: FormatItem -> FormatItem -> Bool # | |
Show FormatItem Source # | |
Defined in Data.Text.Format.Heavy.Types showsPrec :: Int -> FormatItem -> ShowS # show :: FormatItem -> String # showList :: [FormatItem] -> ShowS # |
String format
class (Default f, Show f) => IsVarFormat f where Source #
Can be used for different data types describing formats of specific types.
Instances
IsVarFormat () Source # | |
Defined in Data.Text.Format.Heavy.Types | |
IsVarFormat BoolFormat Source # | |
Defined in Data.Text.Format.Heavy.Instances parseVarFormat :: Text -> Either String BoolFormat Source # | |
IsVarFormat GenericFormat Source # | |
Defined in Data.Text.Format.Heavy.Instances |
class Formatable a where Source #
Value that can be formatted to be substituted into format string.
:: VarFormat | Variable format specification in text form. Nothing is for default format. |
-> a | Variable value. |
-> Either String Builder | Left for errors in variable format syntax, or errors during formatting. |
Format variable according to format specification. This function should usually parse format specification by itself.
Instances
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.
Instances
class VarContainer c => ClosedVarContainer c where Source #
allVarNames :: c -> [VarName] Source #