Safe Haskell | None |
---|---|
Language | Haskell98 |
Text.PrinterParser
Description
Module for saving and restoring preferences and settings
- type Printer beta = beta -> Doc
- type Parser beta = CharParser () beta
- data FieldDescriptionS alpha = FDS {
- parameters :: Parameters
- fieldPrinter :: alpha -> Doc
- fieldParser :: alpha -> CharParser () alpha
- type MkFieldDescriptionS alpha beta = Parameters -> Printer beta -> Parser beta -> Getter alpha beta -> Setter alpha beta -> FieldDescriptionS alpha
- mkFieldS :: MkFieldDescriptionS alpha beta
- applyFieldParsers :: a -> [a -> CharParser () a] -> CharParser () a
- boolParser :: CharParser () Bool
- intParser :: CharParser () Int
- lineParser :: CharParser () Text
- pairParser :: CharParser () alpha -> CharParser () (alpha, alpha)
- identifier :: CharParser st Text
- emptyParser :: CharParser () ()
- whiteSpace :: CharParser st ()
- stringParser :: CharParser () Text
- readParser :: Read a => CharParser () a
- colorParser :: CharParser () Color
- emptyPrinter :: () -> Doc
- class Pretty a where
- prettyPrint :: Pretty a => a -> Text
- maybePP :: (a -> Doc) -> Maybe a -> Doc
- symbol :: Text -> CharParser st Text
- colon :: CharParser st Text
- writeFields :: FilePath -> alpha -> [FieldDescriptionS alpha] -> IO ()
- showFields :: alpha -> [FieldDescriptionS alpha] -> Text
- readFields :: FilePath -> [FieldDescriptionS alpha] -> alpha -> IO alpha
- parseFields :: alpha -> [FieldDescriptionS alpha] -> CharParser () alpha
Documentation
type Parser beta = CharParser () beta #
data FieldDescriptionS alpha #
Constructors
FDS | |
Fields
|
type MkFieldDescriptionS alpha beta = Parameters -> Printer beta -> Parser beta -> Getter alpha beta -> Setter alpha beta -> FieldDescriptionS alpha #
mkFieldS :: MkFieldDescriptionS alpha beta #
applyFieldParsers :: a -> [a -> CharParser () a] -> CharParser () a #
boolParser :: CharParser () Bool #
intParser :: CharParser () Int #
lineParser :: CharParser () Text #
pairParser :: CharParser () alpha -> CharParser () (alpha, alpha) #
identifier :: CharParser st Text #
emptyParser :: CharParser () () #
whiteSpace :: CharParser st () #
stringParser :: CharParser () Text #
readParser :: Read a => CharParser () a #
colorParser :: CharParser () Color #
emptyPrinter :: () -> Doc #
Things that can be pretty-printed
Methods
Pretty-print something in isolation.
prettyPrec :: Int -> a -> Doc #
Pretty-print something in a precedence context.
prettyPrint :: Pretty a => a -> Text #
pretty-print with the default style and defaultMode
.
symbol :: Text -> CharParser st Text #
colon :: CharParser st Text #
writeFields :: FilePath -> alpha -> [FieldDescriptionS alpha] -> IO () #
showFields :: alpha -> [FieldDescriptionS alpha] -> Text #
readFields :: FilePath -> [FieldDescriptionS alpha] -> alpha -> IO alpha #
parseFields :: alpha -> [FieldDescriptionS alpha] -> CharParser () alpha #