Safe Haskell | None |
---|
An interface for other Penny components to use. A report is
anything that is a Report
.
- type PosArg = String
- type HelpStr = String
- type ArgsAndReport = ([PosArg], PrintReport)
- type ParseResult = Exceptional String (Either HelpStr ArgsAndReport)
- type PrintReport = [Transaction] -> [PricePoint] -> Exceptional Text [PreChunk]
- type Report = Runtime -> (HelpStr, MkReport)
- type MkReport = CaseSensitive -> (CaseSensitive -> Text -> Exceptional Text (Text -> Bool)) -> ([Transaction] -> [Box LibertyMeta]) -> Mode ParseResult
Documentation
The function that will print the report, and the positional arguments. If there was a problem parsing the command line options, return an Exception with an error message.
Parsing the filter options can have one of two results: a help string, or a list of positional arguments and a function that prints a report. Or, the parse might fail.
type ArgsAndReport = ([PosArg], PrintReport)Source
type PrintReportSource
= [Transaction] | All transactions; the report must sort and filter them |
-> [PricePoint] | PricePoints to be included in the report |
-> Exceptional Text [PreChunk] | The exception type is a strict Text, containing the error message. The success type is a list of PreChunks containing the resulting report. This allows for errors after the list of transactions has been seen. |
= CaseSensitive | Result from previous parses indicating whether the user desires case sensitivity (this may have been changed in the filtering options) |
-> (CaseSensitive -> Text -> Exceptional Text (Text -> Bool)) | Result from previous parsers indicating the matcher factory the user wishes to use |
-> ([Transaction] -> [Box LibertyMeta]) | Result from previous parsers that will sort and filter incoming transactions |
-> Mode ParseResult |