! . v      !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~      !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~                                                            ! " # $ % & ' ( ) * + , - . / 0 1 2 3 4 5 6 7 8 9 : ; < = > ? @ A B C D E F G H I J K L M N OPQRSTUVWXYZ[ \ ] ^ _ ` a b c d e f g h i j k l m n o p q r s t u v w x y z { | } ~                           !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~      !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~                                                                            !!!!!""""######$$$$$$$$$$$%%%%%%%%%%%%%%%%%%% % % % % %%%%%%%%%%%%%%%%%%% %!%"%#%$%%%&%'%(%)%*%+%,%-%.%/%0%1%2%3%4%5%6%7%8%9%:%;%<%=%>%?%@%A%B%C%D%E%F%G%H%I%J&K&L'M'N(O(P(Q(R(S(T(U(V(W(X(Y(Z([(\(](^(_(`)a)b)c)d)e)f)g)h)i)j*k*l*m*n*o*p*q*r*s*t+u+v+w+x+y+z+{+|+}+~++++++++++,,,,,,,,,,,-----------...../02SafeL( hledger-lib?Wrap a string in ANSI codes to set and reset foreground colour.) hledger-lib?Wrap a string in ANSI codes to set and reset background colour. ()() SafeNo* hledger-lib`An efficient-to-build tree suggested by Cale Gibbard, probably better than accountNameTreeFrom.*+,*+,SafeQ0 hledger-lib&A SystemString-aware version of error.1 hledger-lib*A SystemString-aware version of userError.2 hledger-lib=A SystemString-aware version of error that adds a usage hint. 012  012None=?@AX[3 hledger-lib;An regular expression compilation/processing error message.4 hledger-lib>A replacement pattern. May include numeric backreferences (N).5 hledger-libaRegular expression. Extended regular expression-ish syntax ? But does not support eg (?i) syntax. hledger-lib-Make a nice error message for a regexp error.; hledger-lib=Test whether a Regexp matches a String. This is an alias for  for consistent naming.< hledger-libzA memoising version of regexReplace. Caches the result for each search pattern, replacement pattern, target string tuple. 3456789:;<=> 56789:43;<=>None"#17=?QF hledger-libA Ledger has the journal it derives from, and the accounts derived from that. Accounts are accessible both list-wise and tree-wise, since each one knows its parent and subs; the first account is the root of the tree and always exists.J hledger-libWhether an account's balance is normally a positive number (in accounting terms, a debit balance) or a negative number (credit balance). Assets and expenses are normally positive (debit), while liabilities, equity and income are normally negative (credit). ,https://en.wikipedia.org/wiki/Normal_balanceM hledger-libAn account, with its balances, parent/subaccount relationships, etc. Only the name is required; the other fields are added when needed.O hledger-libthis account's full nameP hledger-libFoptional extra info from account directives relationships in the treeQ hledger-libthis account's sub-accountsR hledger-libparent accountS hledger-libJused in the accounts report to label elidable parents balance informationT hledger-lib&the number of postings to this accountU hledger-lib-this account's balance, excluding subaccountsV hledger-lib-this account's balance, including subaccountsW hledger-libvExtra information about an account that can be derived from its account directive (and the other account directives).Y hledger-libAany comment lines following an account directive for this accountZ hledger-lib/tags extracted from the account comment, if any[ hledger-libmthe order in which this account was declared, relative to other account declarations, during parsing (1..)\ hledger-lib2The id of a data format understood by hledger, eg journal or csv>. The --output-format option selects one of these for output.] hledger-libxA journal in the process of being parsed, not yet finalised. The data is partial, and list fields are in reverse order.^ hledger-lib_A Journal, containing transactions and various other things. The basic data model for hledger.^This is used during parsing (as the type alias ParsedJournal), and then finalised/validated for use as a Journal. Some extra parsing-related fields are included for convenience, at least for now. In a ParsedJournal these are updated as parsing proceeds, in a Journal they represent the final state at end of parsing (used eg by the add command).` hledger-libTthe current default year, specified by the most recent Y directive (or current date)a hledger-libVthe current default commodity and its format, specified by the most recent D directiveb hledger-libPthe current stack of parent account names, specified by apply account directivesc hledger-libthe current account name aliases in effect, specified by alias directives (& options ?) ,jparsetransactioncount :: Integer -- ^ the current count of transactions parsed so far (only journal format txns, currently)d hledger-lib2timeclock sessions which have not been clocked outf hledger-libTAccounts declared by account directives, in parse order (after journal finalisation)g hledger-libZAccounts whose type has been declared in account directives (usually 5 top-level accounts)h hledger-lib8commodities and formats declared by commodity directivesi hledger-lib^commodities and formats inferred from journal amounts TODO misnamed, should be eg jusedstylesj hledger-libZDeclarations of market prices by P directives, in parse order (after journal finalisation)k hledger-libRMarket prices implied by transactions, in parse order (after journal finalisation)o hledger-lib6any final trailing comments in the (main) journal filep hledger-libthe file path and raw text of the main and any included journal files. The main file is first, followed by any included files in the order encountered.q hledger-lib0when this journal was last read from its file(s)r hledger-libA historical market price (exchange rate) from one commodity to another. A more concise form of a PriceDirective, without the amount display info.t hledger-lib+Date on which this price becomes effective.u hledger-lib#The commodity being converted from.v hledger-lib!The commodity being converted to.w hledger-libNOne unit of the "from" commodity is worth this quantity of the "to" commodity.x hledger-libA market price declaration made by the journal format's P directive. It declares two things: a historical exchange rate between two commodities, and an amount display style for the second commodity. hledger-libBA periodic transaction rule, describing a transaction that recurs. hledger-lib the period expression as written hledger-lib-the interval at which this transaction recurs hledger-libkthe (possibly unbounded) period during which this transaction recurs. Contains a whole number of intervals. hledger-libsome of Transaction's fields hledger-libA transaction modifier transformation, which adds an extra posting to the matched posting's transaction. Can be like a regular posting, or the amount can have the aismultiplier flag set, indicating that it's a multiplier for the matched posting's amount. hledger-lib|A transaction modifier rule. This has a query which matches postings in the journal, and a list of transformations to apply to those postings or their transactions. Currently there is one kind of transformation: the TMPostingRule, which adds a posting ("auto posting") to the transaction, optionally setting its amount to the matched posting's amount multiplied by a constant. hledger-libVthis transaction's 1-based position in the transaction stream, or 0 when not available hledger-lib8any comment lines immediately preceding this transaction hledger-lib'the file position where the date starts hledger-libLthis transaction's comment lines, as a single non-indented multi-line string hledger-lib0tag names and values, extracted from the comment hledger-libthis transaction's postings hledger-libGThe position of parse errors (eg), like parsec's SourcePos but generic. hledger-lib9file path, 1-based line number and 1-based column number. hledger-libAfile path, inclusive range of 1-based line numbers (first, last). hledger-lib8this posting's date, if different from the transaction's hledger-libBthis posting's secondary date, if different from the transaction's hledger-libHthis posting's comment lines, as a single non-indented multi-line string hledger-lib0tag names and values, extracted from the comment hledger-libgan expected balance in the account after this posting, in a single commodity, excluding subaccounts. hledger-libxthis posting's parent transaction (co-recursive types). Tying this knot gets tedious, Maybe makes it easier/optional. hledger-libWhen this posting has been transformed in some way (eg its amount or price was inferred, or the account name was changed by a pivot or budget report), this references the original untransformed posting (which will have Nothing in this field). hledger-libA balance assertion is a declaration about an account's expected balance at a certain point (posting date and parse order). They provide additional error checking and readability to a journal file.The  type is also used to represent balance assignments, which instruct hledger what an account's balance should become at a certain point.SDifferent kinds of balance assertions are discussed eg on #290. Variables include:%which postings are to be summed (realvirtual; unmarkedpendingcleared; this accountthis account including subs)6which commodities within the balance are to be checkedHwhether to do a partial or a total check (disallowing other commodities)I suspect we want: partial, subaccount-exclusive, Ledger-compatible assertions. Because they're what we've always had, and removing them would break some journals unnecessarily. Implemented with = syntax._total assertions. Because otherwise assertions are a bit leaky. Implemented with == syntax.Zsubaccount-inclusive assertions. Because that's something folks need. Not implemented.flexible assertions allowing custom criteria (perhaps arbitrary queries). Because power users have diverse needs and want to try out different schemes (assert cleared balances, assert balance from real or virtual postings, etc.). Not implemented.umulticommodity assertions, asserting the balance of multiple commodities at once. Not implemented, requires #934. hledger-lib.the expected balance in a particular commodity hledger-lib.disallow additional non-asserted commodities ? hledger-lib9include subaccounts when calculating the actual balance ? hledger-lib2the assertion's file position, for error reporting hledger-libThe status of a transaction or posting, recorded with a status mark (nothing, !, or *). What these mean is ultimately user defined. hledger-libkludge: a flag marking this amount and posting as a multiplier in a TMPostingRule. In a regular Posting, should always be false. hledger-lib?the (fixed, transaction-specific) price for this amount, if any hledger-libsA style for displaying digit groups in the integer part of a floating point number. It consists of the character used to separate groups (comma or period, whichever is not used as decimal point), and the size of each group, starting with the one nearest the decimal point. The last group size is assumed to repeat. Eg, comma between thousands is DigitGroups ',' [3]. hledger-libDisplay style for an amount. hledger-lib1does the symbol appear on the left or the right ? hledger-lib#space between symbol and quantity ? hledger-lib2number of digits displayed after the decimal point hledger-libZcharacter used as decimal point: period or comma. Nothing means "unspecified, use default" hledger-lib)style for displaying digit groups, if any hledger-libqAn amount's per-unit or total cost/selling price in another commodity, as recorded in the journal entry eg with  or F@. Docs call this "transaction price". The amount is always positive. hledger-lib'The basic numeric type used in amounts. hledger-lib=a subtype of Asset - liquid assets to show in cashflow report! hledger-libNA possibly incomplete year-month-day date provided by the user, to be interpreted as either a date or a date span depending on context. Missing parts "on the left" will be filled from the provided reference date, e.g. if the year and month are missing, the reference date's year and month are used. Missing parts "on the right" are assumed, when interpreting as a date, to be 1, (e.g. if the year and month are present but the day is missing, it means first day of that month); or when interpreting as a date span, to be a wildcard (so it would mean all days of that month). See the  smartdate parser for more examples.Or, one of the standard periods and an offset relative to the reference date: (last|this|next) (day|week|month|quarter|year), where "this" means the period containing the reference date./ hledger-libSPosting's show instance elides the parent transaction so as not to recurse forever. hledger-lib&A tag name and (possibly empty) value.FGIHJLKMNVUTSRQPOWX[ZY\]^_qponmlkjihgfedcba`rswvutxy|{z}~      !%$#"&'(!%$#"      &'}~xy|{zrswvut^_qponmlkjihgfedcba`]\WX[ZY(MNVUTSRQPOJLKFGIHNoneD[  hledger-libConvert Periods to DateSpans.qperiodAsDateSpan (MonthPeriod 2000 1) == DateSpan (Just $ fromGregorian 2000 1 1) (Just $ fromGregorian 2000 2 1)True hledger-libConvert DateSpans to Periods.[dateSpanAsPeriod $ DateSpan (Just $ fromGregorian 2000 1 1) (Just $ fromGregorian 2000 2 1)MonthPeriod 2000 1 hledger-lib@Convert PeriodBetweens to a more abstract period where possible.JsimplifyPeriod $ PeriodBetween (fromGregorian 1 1 1) (fromGregorian 2 1 1) YearPeriod 1QsimplifyPeriod $ PeriodBetween (fromGregorian 2000 10 1) (fromGregorian 2001 1 1)QuarterPeriod 2000 4PsimplifyPeriod $ PeriodBetween (fromGregorian 2000 2 1) (fromGregorian 2000 3 1)MonthPeriod 2000 2QsimplifyPeriod $ PeriodBetween (fromGregorian 2016 7 25) (fromGregorian 2016 8 1)WeekPeriod 2016-07-25PsimplifyPeriod $ PeriodBetween (fromGregorian 2000 1 1) (fromGregorian 2000 1 2)DayPeriod 2000-01-01QsimplifyPeriod $ PeriodBetween (fromGregorian 2000 2 28) (fromGregorian 2000 3 1)#PeriodBetween 2000-02-28 2000-03-01QsimplifyPeriod $ PeriodBetween (fromGregorian 2000 2 29) (fromGregorian 2000 3 1)DayPeriod 2000-02-29RsimplifyPeriod $ PeriodBetween (fromGregorian 2000 12 31) (fromGregorian 2001 1 1)DayPeriod 2000-12-31 hledger-libIs this period a "standard" period, referencing a particular day, week, month, quarter, or year ? Periods of other durations, or infinite duration, or not starting on a standard period boundary, are not. hledger-libERender a period as a compact display string suitable for user output.1showPeriod (WeekPeriod (fromGregorian 2016 7 25))"2016-07-25W30" hledger-libsLike showPeriod, but if it's a month period show just the 3 letter month name abbreviation for the current locale. hledger-libfMove a standard period to the following period of same duration. Non-standard periods are unaffected. hledger-libfMove a standard period to the preceding period of same duration. Non-standard periods are unaffected. hledger-libMove a standard period to the following period of same duration, staying within enclosing dates. Non-standard periods are unaffected. hledger-libMove a standard period to the preceding period of same duration, staying within enclosing dates. Non-standard periods are unaffected. hledger-libiMove a standard period stepwise so that it encloses the given date. Non-standard periods are unaffected. hledger-lib'Enlarge a standard period to the next larger enclosing standard period, if there is one. Eg, a day becomes the enclosing week. A week becomes whichever month the week's thursday falls into. A year becomes all (unlimited). Non-standard periods (arbitrary dates, or open-ended) are unaffected. hledger-libShrink a period to the next smaller standard period inside it, choosing the subperiod which contains today's date if possible, otherwise the first subperiod. It goes like this: unbounded periods and nonstandard periods (between two arbitrary dates) -> current year -> current quarter if it's in selected year, otherwise first quarter of selected year -> current month if it's in selected quarter, otherwise first month of selected quarter -> current week if it's in selected month, otherwise first week of selected month -> today if it's in selected week, otherwise first day of selected week, unless that's in previous month, in which case first day of month containing selected week. Shrinking a day has no effect.None"#17=?J hledger-libBShow a JSON-convertible haskell value as pretty-printed JSON text. hledger-libqWrite a JSON-convertible haskell value to a pretty-printed JSON file. Eg: writeJsonFile "a.json" nulltransaction hledger-lib~Read a JSON file and decode it to the target type, or raise an error if we can't. Eg: readJsonFile "a.json" :: IO Transaction1SafeK52None 1=>?WX_C hledger-libA type bundling a ` with its full source text, filepath, and stack of include files. Suitable for pretty-printing. Megaparsec's v type already bundles a parse error with its full source text and filepath, so we just add a stack of include files. hledger-libA type representing "final" parse errors that cannot be backtracked from and are guaranteed to halt parsing. The anti-backtracking behaviour is implemented by an < layer in the parser's monad stack, using this type as the  error type.We have three goals for this type: (1) it should be possible to convert any parse error into a "final" parse error, (2) it should be possible to take a parse error thrown from an include file and re-throw it in the parent file, and (3) the pretty-printing of "final" parse errors should be consistent with that of ordinary parse errors, but should also report a stack of files for errors thrown from include files.In order to pretty-print a "final" parse error (goal 3), it must be bundled with include filepaths and its full source text. When a "final" parse error is thrown from within a parser, we do not have access to the full source, so we must hold the parse error until it can be joined with its source (and include filepaths, if it was thrown from an include file) by the parser's caller.UA parse error with include filepaths and its full source text is represented by the r type, while a parse error in need of either include filepaths, full source text, or both is represented by the  type. hledger-libA fragment of source suitable for "re-parsing". The purpose of this data type is to preserve the content and source position of the excerpt so that parse errors raised during "re-parsing" may properly reference the original source. hledger-libKA custom error type for the parser. The type is specialized to parsers of  streams. hledger-libqFail with a message at a specific source position interval. The interval must be contained within a single line. hledger-libWRe-throw parse errors obtained from the "re-parsing" of an excerpt of the source text. hledger-libFail at a specific source position, given by the raw offset from the start of the input stream (the number of tokens processed at that point). hledger-libFail at a specific source interval, given by the raw offsets of its endpoints from the start of the input stream (the numbers of tokens processed at those points).Note that care must be taken to ensure that the specified interval does not span multiple lines of the input source. This will not be checked. hledger-lib%Get the raw text of a source excerpt. hledger-lib&'excerpt_ p' applies the given parser p5 and extracts the portion of the source consumed by p, along with the source position of this portion. This is the only way to create a source excerpt suitable for "re-parsing" by . hledger-lib4'reparseExcerpt s p' "re-parses" the source excerpt s using the parser p. Parse errors raised by pA will be re-thrown at the source position of the source excerpt.In order for the correct source file to be displayed when re-throwing parse errors, we must ensure that the source file during the use of 'reparseExcerpt s p' is the same as that during the use of $ that generated the source excerpt s. However, we can usually expect this condition to be satisfied because, at the time of writing, the only changes of source file in the codebase take place through include files, and the parser for include files neither accepts nor returns s. hledger-libNPretty-print our custom parse errors. It is necessary to use this instead of % when custom parse errors are thrown.QThis function intercepts our custom parse errors and applies final adjustments (finalizeCustomError) before passing them to `. These adjustments are part of the implementation of the behaviour of our custom parse errors.,Note: We must ensure that the offset of the  of the provided . is no larger than the offset specified by a  constructor. This is guaranteed if this offset is set to 0 (that is, the beginning of the source file), which is the case for s returned from . hledger-lib;Convert a "regular" parse error into a "final" parse error. hledger-libLike megaparsec's , but as a "final" parse error. hledger-libLike , but as a "final" parse error. hledger-libLike megaparsec's , but as a "final" parse error. hledger-libPretty-print a "final" parse error: print the stack of include files, then apply the pretty-printer for parse error bundles. Note that H must be used on a "final" parse error before it can be pretty-printed. hledger-libSupply a filepath and source text to a "final" parse error so that it can be pretty-printed. You must ensure that you provide the appropriate source text and filepath. hledger-libParse a file with the given parser and initial state, discarding the final state and re-throwing any parse errors as "final" parse errors. hledger-lib Start offset hledger-libEnd end offset hledger-lib Error message None>HV hledger-libA parser of text that runs in some monad, keeping a Journal as state, that can throw an exception to end parsing, preventing further parser backtracking. hledger-libEA parser of text that runs in some monad, keeping a Journal as state. hledger-lib)A parser of text that runs in some monad. hledger-lib%A parser of strict text to some type. hledger-lib A parser of string to some type. hledger-libgBacktracking choice, use this when alternatives share a prefix. Consumes no input if all choices fail. hledger-libgBacktracking choice, use this when alternatives share a prefix. Consumes no input if all choices fail. hledger-libdRun a stateful parser with some initial state on a text. See also: runTextParser, runJournalParser. None hledger-lib%Take elements from the end of a list. hledger-lib'Remove leading and trailing whitespace. hledger-libRemove leading whitespace. hledger-libRemove trailing whitespace. hledger-lib*Remove trailing newlines/carriage returns. hledger-lib@Remove consecutive line breaks, replacing them with single space hledger-lib7Clip and pad a string to a minimum & maximum width, andor left\right justify it. Works on multi-line strings too (but will rewrite non-unix line endings).  hledger-libsDouble-quote this string if it contains whitespace, single quotes or double-quotes, escaping the quotes as needed.  hledger-libsSingle-quote this string if it contains whitespace or double-quotes. No good for strings containing single quotes.  hledger-libtQuote-aware version of words - don't split on spaces which are inside quotes. NB correctly handles "a'b" but not "'a''". Can raise an error if parsing fails.  hledger-libNQuote-aware version of unwords - single-quote strings which contain whitespace hledger-libKStrip one matching pair of single or double quotes on the ends of a string. hledger-libJoin several multi-line strings as side-by-side rectangular strings of the same height, top-padded. Treats wide characters as double width. hledger-libJoin several multi-line strings as side-by-side rectangular strings of the same height, bottom-padded. Treats wide characters as double width. hledger-libJoin multi-line strings horizontally, after compressing each of them to a single line with a comma and space between each original line. hledger-lib7Join strings vertically, left-aligned and right-padded. hledger-lib7Join strings vertically, right-aligned and left-padded. hledger-libWConvert a multi-line string to a rectangular string top-padded to the specified height. hledger-libZConvert a multi-line string to a rectangular string bottom-padded to the specified height. hledger-libConvert a multi-line string to a rectangular string left-padded to the specified width. Treats wide characters as double width. hledger-libConvert a multi-line string to a rectangular string right-padded to the specified width. Treats wide characters as double width. hledger-libMClip a multi-line string to the specified width and height from the top left. hledger-libHClip and pad a multi-line string to fill the specified width and height. hledger-lib{General-purpose wide-char-aware single-line string layout function. It can left- or right-pad a short string to a minimum width. It can left- or right-clip a long string to a maximum width, optionally inserting an ellipsis (the third argument). It clips and pads on the right when the fourth argument is true, otherwise on the left. It treats wide characters as double width. hledger-libA version of fitString that works on multi-line strings, separate for now to avoid breakage. This will rewrite any line endings to unix newlines. hledger-libLeft-pad a string to the specified width. Treats wide characters as double width. Works on multi-line strings too (but will rewrite non-unix line endings). hledger-libRight-pad a string to the specified width. Treats wide characters as double width. Works on multi-line strings too (but will rewrite non-unix line endings). hledger-libDouble-width-character-aware string truncation. Take as many characters as possible from a string without exceeding the specified width. Eg takeWidth 3 "000T" = "0". hledger-libCalculate the render width of a string, considering wide characters (counted as double width), ANSI escape codes (not counted), and line breaks (in a multi-line string, the longest line determines the width).! hledger-libGet the designated render width of a character: 0 for a combining character, 1 for a regular character, 2 for a wide character. (Wide characters are rendered as exactly double width in apps and fonts that support it.) (From Pandoc.)%      !%      ! None>HV" hledger-lib4Pretty print. Easier alias for pretty-show's pPrint.# hledger-lib3Pretty show. Easier alias for pretty-show's ppShow.$ hledger-lib4Pretty trace. Easier alias for traceShowId + ppShow.% hledger-libsLike traceShowId, but uses a custom show function to render the value. traceShowIdWith was too much of a mouthful.& hledger-libGlobal debug level, which controls the verbosity of debug output on the console. The default is 0 meaning no debug output. The --debug$ command line flag sets it to 1, or  --debug=N' sets it to a higher value (note: not  --debug N, for some reason). This uses unsafePerformIO and can be accessed from anywhere and before normal command-line processing. When running with :main in GHCI, you must touch and reload this module to see the effect of a new --debug option. After command-line processing, it is also available as the debug_ field of 34. {- OPTIONS_GHC -fno-cse -} {- NOINLINE debugLevel -}' hledger-libTrace (print to stderr) a string if the global debug level is at or above the specified level. At level 0, always prints. Otherwise, uses unsafePerformIO.( hledger-libFTrace (print to stderr) a showable value using a custom show function.) hledger-libPretty-print a label and a showable value to the console if the global debug level is at or above the specified level. At level 0, always prints. Otherwise, uses unsafePerformIO.* hledger-libCLike ptraceAt, but takes a custom show function instead of a label.+ hledger-libKPretty-print a label and the showable value to the console, then return it., hledger-libPretty-print a label and the showable value to the console when the global debug level is >= 1, then return it. Uses unsafePerformIO.5 hledger-lib?Like dbg0, but takes a custom show function instead of a label.? hledger-lib;Like dbg0, but also exit the program. Uses unsafePerformIO.@ hledger-lib Like ptraceAt, but convenient to insert in an IO monad and enforces monadic sequencing (plus convenience aliases). XXX These have a bug; they should use traceIO, not trace, otherwise GHC can occasionally over-optimise (cf lpaste a few days ago where it killed/blocked a child thread).K hledger-libfLog a label and a pretty-printed showable value to ./debug.log, then return it. Can fail, see plogAt.L hledger-libHLog a label and a pretty-printed showable value to ./debug.log, if the global debug level is at or above the specified level. At level 0, always logs. Otherwise, uses unsafePerformIO. Tends to fail if called more than once, at least when built with -threaded (Exception: debug.log: openFile: resource busy (file is locked)).M hledger-libPrint the provided label (if non-null) and current parser state (position and next input) to the console. (See also megaparsec's dbg.) hledger-libPrint the provided label (if non-null) and current parser state (position and next input) to the console if the global debug level is at or above the specified level. Uses unsafePerformIO. (See also megaparsec's dbg.)N hledger-lib"Convenience alias for traceParseAt:"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMN-"#$%'(&)*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNNone>X) O hledger-libMName and group a list of tests. Shorter alias for Test.Tasty.HUnit.testGroup.P hledger-libYName an assertion or sequence of assertions. Shorter alias for Test.Tasty.HUnit.testCase.Q hledger-libAssert any Left value.R hledger-libAssert any Right value.S hledger-libAssert that this stateful parser runnable in IO successfully parses all of the given input text, showing the parse error if it fails. Suitable for hledger's JournalParser parsers.T hledger-lib+Assert a parser produces an expected value.U hledger-lib`Like assertParseEq, but transform the parse result with the given function before comparing it.V hledger-libAssert that this stateful parser runnable in IO fails to parse the given input text, with a parse error containing the given string.W hledger-libRun a stateful parser in IO like assertParse, then assert that the final state (the wrapped state, not megaparsec's internal state), transformed by the given function, matches the given expected value.X hledger-libThese EP variants of the above are suitable for hledger's ErroringJournalParser parsers.2"! #$'&%OPQRSTUVWXYZ"! #$'&%OPQRSTUVXYZW NoneDl \ hledger-libWrap a string in double quotes, and -prefix any embedded single quotes, if it contains whitespace and is not already single- or double-quoted._ hledger-libKStrip one matching pair of single or double quotes on the ends of a string.a hledger-libJoin several multi-line strings as side-by-side rectangular strings of the same height, top-padded. Treats wide characters as double width.b hledger-libyGeneral-purpose wide-char-aware single-line text layout function. It can left- or right-pad a short string to a minimum width. It can left- or right-clip a long string to a maximum width, optionally inserting an ellipsis (the third argument). It clips and pads on the right when the fourth argument is true, otherwise on the left. It treats wide characters as double width.c hledger-libLeft-pad a text to the specified width. Treats wide characters as double width. Works on multi-line texts too (but will rewrite non-unix line endings).d hledger-libRight-pad a string to the specified width. Treats wide characters as double width. Works on multi-line strings too (but will rewrite non-unix line endings).e hledger-libDouble-width-character-aware string truncation. Take as many characters as possible from a string without exceeding the specified width. Eg textTakeWidth 3 "000T" = "0".f hledger-libCalculate the designated render width of a string, taking into account wide characters and line breaks (the longest line within a multi-line string determines the width ).g hledger-libXRead a decimal number from a Text. Assumes the input consists only of digit characters.[\]^_`abcdefgh`\]^_[abfecdgh None_[>  hledger-libzApply a function the specified number of times, which should be > 0 (otherwise does nothing). Possibly uses O(n) stack ? hledger-libConvert a possibly relative, possibly tilde-containing file path to an absolute one, given the current directory. ~username is not supported. Leave "-" unchanged. Can raise an error. hledger-lib/Expand user home path indicated by tilde prefix hledger-libRead text from a file, converting any rn line endings to n,, using the system locale's text encoding, ignoring any utf8 BOM prefix (as seen in paypal's 2018 CSV, eg) if that encoding is utf8. hledger-libGLike readFilePortably, but read from standard input if the path is "-". hledger-libITotal version of maximum, for integral types, giving 0 for an empty list. hledger-lib-Strict version of sum that doesn t leak space hledger-lib1Strict version of maximum that doesn t leak space hledger-lib1Strict version of minimum that doesn t leak space hledger-lib"This is a version of sequence based on difference lists. It is slightly faster but we mostly use it because it uses the heap instead of the stack. This has the advantage that Neil Mitchell s trick of limiting the stack size to discover space leaks doesn t show this as a false positive. hledger-libLike mapM but uses sequence'. hledger-libcLike embedFile, but takes a path relative to the package directory. Similar to embedFileRelative ? "! #$'&%()*+,0123456789:;<=>      !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~,ijklmnopqrstuvwxyz{|}~012Nonez  hledger-libTThe result of running cmdargs: an association list of option names to string values. hledger-libIs the named option present ? hledger-libFrom a list of RawOpts, get the last one (ie the right-most on the command line) for which the given predicate returns a Just value. Useful for exclusive choice flags like --daily|--weekly|--quarterly...import Safe (readMay)7choiceopt Just (RawOpts [("a",""), ("b",""), ("c","")])Just "c".choiceopt (const Nothing) (RawOpts [("a","")])NothingRchoiceopt readMay (RawOpts [("LT",""),("EQ",""),("Neither","")]) :: Maybe OrderingJust EQ hledger-libFCollects processed and filtered list of options preserving their order0collectopts (const Nothing) (RawOpts [("x","")])[].collectopts Just (RawOpts [("a",""),("b","")])[("a",""),("b","")] hledger-libyReads the named option's Int argument, if it is present. An argument that is too small or too large will raise an error. hledger-libReads the named option's natural-number argument, if it is present. An argument that is negative or too large will raise an error. hledger-libReads the named option's Int argument. If not present it will return 0. An argument that is too small or too large will raise an error. hledger-libReads the named option's natural-number argument. If not present it will return 0. An argument that is negative or too large will raise an error. hledger-libReads the named option's Int argument, if it is present. An argument that does not fit within the given bounds will raise an error. hledger-lib"parser" that returns  value for valid choice hledger-lib%actual options where to look for flag hledger-lib)exclusive choice among those returned as  from "parser"None} hledger-lib6Look up one of the sample commodities' symbol by name. hledger-libFFind the conversion rate between two commodities. Currently returns 1.None"#1C hledger-libDefault amount style hledger-libThe empty simple amount. hledger-libThe empty simple amount. hledger-libHA temporary value for parsed transactions which had no amount specified. hledger-libApply a binary arithmetic operator to two amounts, which should be in the same commodity if non-zero (warning, this is not checked). A zero result keeps the commodity of the second amount. The result's display style is that of the second amount, with precision set to the highest of either amount. Prices are ignored and discarded. Remember: the caller is responsible for ensuring both amounts have the same commodity. hledger-lib~Convert an amount to the specified commodity, ignoring and discarding any assigned prices and assuming an exchange rate of 1. hledger-libConvert a amount to its "cost" or "selling price" in another commodity, using its attached transaction price if it has one. Notes:nprice amounts must be MixedAmounts with exactly one component Amount (or there will be a runtime error XXX)Kprice amounts should be positive (though this is currently not enforced) hledger-lib=Replace an amount's TotalPrice, if it has one, with an equivalent UnitPrice. Has no effect on amounts without one. Also increases the unit price's display precision to show one extra decimal place, to help keep transaction amounts balancing. Does Decimal division, might be some rounding/irrational number issues. hledger-lib*Divide an amount's quantity by a constant. hledger-lib,Multiply an amount's quantity by a constant. hledger-libDivide an amount's quantity (and its total price, if it has one) by a constant. The total price will be kept positive regardless of the multiplier's sign. hledger-libMultiply an amount's quantity (and its total price, if it has one) by a constant. The total price will be kept positive regardless of the multiplier's sign. hledger-lib/Is this amount negative ? The price is ignored. hledger-liboRound an Amount's Quantity to its specified display precision. If that is NaturalPrecision, this does nothing. hledger-libODoes mixed amount appear to be zero when rendered with its display precision ? hledger-lib=Is this amount exactly zero, ignoring its display precision ? hledger-lib|Get the string representation of an amount, based on its commodity's display settings except using the specified precision. hledger-lib+Set an amount's display precision, flipped. hledger-lib"Set an amount's display precision. hledger-libIncrease an amount's display precision, if needed, to enough decimal places to show it exactly (showing all significant decimal digits, excluding trailing zeros). hledger-libxGet a string representation of an amount for debugging, appropriate to the current debug level. 9 shows maximum detail. hledger-libGet the string representation of an amount, without any @ price. With a True argument, adds ANSI codes to show negative amounts in red. hledger-libSet an amount's internal precision, ie rounds the Decimal representing the amount's quantity to some number of decimal places. Rounding is done with Data.Decimal's default roundTo function: "If the value ends in 5 then it is rounded to the nearest even value (Banker's Rounding)". Does not change the amount's display precision. Intended only for internal use, eg when comparing amounts in tests. hledger-libqSet an amount's internal precision, flipped. Intended only for internal use, eg when comparing amounts in tests. hledger-lib1Set (or clear) an amount's display decimal point. hledger-lib:Set (or clear) an amount's display decimal point, flipped. hledger-libGiven a map of standard commodity display styles, apply the appropriate one to this amount. If there's no standard style for this amount's commodity, return the amount unchanged. hledger-libBLike styleAmount, but keep the number of decimal places unchanged. hledger-libGet the string representation of an amount, based on its commodity's display settings. String representations equivalent to zero are converted to just "0". The special "missing" amount is displayed as the empty string. hledger-libjColour version. For a negative amount, adds ANSI codes to change the colour, currently to hard-coded red. hledger-libBLike showAmount, but show a zero amount's commodity if it has one. hledger-libqGet the string representation of the number part of of an amount, using the display settings from its commodity. hledger-libReplace a number string's decimal mark with the specified character, and add the specified digit group marks. The last digit group will be repeated as needed. hledger-libNCanonicalise an amount's display style using the provided commodity style map. hledger-libThe empty mixed amount. hledger-libHA temporary value for parsed transactions which had no amount specified. hledger-libEConvert amounts in various commodities into a normalised MixedAmount. hledger-lib,Simplify a mixed amount's component amounts:\amounts in the same commodity are combined unless they have different prices or total pricesmultiple zero amounts, all with the same non-null commodity, are replaced by just the last of them, preserving the commodity and amount style (all but the last zero amount are discarded)rmultiple zero amounts with multiple commodities, or no commodities, are replaced by one commodity-less zero amountBan empty amount list is replaced by one commodity-less zero amount4the special "missing" mixed amount remains unchanged hledger-libLike normaliseMixedAmount, but combine each commodity's amounts into just one by throwing away all prices except the first. This is only used as a rendering helper, and could show a misleading price. hledger-libUnify a MixedAmount to a single commodity value if possible. Like normaliseMixedAmount, this consolidates amounts of the same commodity and discards zero amounts; but this one insists on simplifying to a single commodity, and will return Nothing if this is not possible. hledger-libSum same-commodity amounts in a lossy way, applying the first price to the result and discarding any other prices. Only used as a rendering helper. hledger-lib'Get a mixed amount's component amounts. hledger-lib9Filter a mixed amount's component amounts by a predicate. hledger-libReturn an unnormalised MixedAmount containing exactly one Amount with the specified commodity and the quantity of that commodity found in the original. NB if Amount's quantity is zero it will be discarded next time the MixedAmount gets normalised. hledger-lib0Apply a transform to a mixed amount's component s. hledger-libUConvert all component amounts to cost/selling price where possible (see amountCost). hledger-lib1Divide a mixed amount's quantities by a constant. hledger-lib3Multiply a mixed amount's quantities by a constant. hledger-libDivide a mixed amount's quantities (and total prices, if any) by a constant. The total prices will be kept positive regardless of the multiplier's sign. hledger-libMultiply a mixed amount's quantities (and total prices, if any) by a constant. The total prices will be kept positive regardless of the multiplier's sign. hledger-lib,Calculate the average of some mixed amounts. hledger-libIs this mixed amount negative, if we can tell that unambiguously? Ie when normalised, are all individual commodity amounts negative ? hledger-libTDoes this mixed amount appear to be zero when rendered with its display precision ? hledger-lib@Is this mixed amount exactly zero, ignoring display precisions ? hledger-libgGiven a map of standard commodity display styles, apply the appropriate one to each individual amount. hledger-libGet the string representation of a mixed amount, after normalising it to one amount per commodity. Assumes amounts have no or similar prices, otherwise this can show misleading prices. hledger-libXLike showMixedAmount, but zero amounts are shown with their commodity if they have one. hledger-lib9Get the one-line string representation of a mixed amount. hledger-lib8Compact labelled trace of a mixed amount, for debugging. hledger-lib6Set the display precision in the amount's commodities. hledger-libGet the string representation of a mixed amount, showing each of its component amounts with the specified precision, ignoring their commoditys' display precision settings. hledger-libIGet an unambiguous string representation of a mixed amount for debugging. hledger-libGet the string representation of a mixed amount, without showing any transaction prices. With a True argument, adds ANSI codes to show negative amounts in red. hledger-libGet the one-line string representation of a mixed amount, but without any @ prices. With a True argument, adds ANSI codes to show negative amounts in red. hledger-libLike showMixedAmountOneLineWithoutPrice, but show at most two commodities, with a elision indicator if there are more. With a True argument, adds ANSI codes to show negative amounts in red. hledger-libTCanonicalise a mixed amount's display styles using the provided commodity style map. hledger-libReplace each component amount's TotalPrice, if it has one, with an equivalent UnitPrice. Has no effect on amounts without one. Does Decimal division, might be some rounding/irrational number issues.GGNone"#$7XR hledger-libA price oracle is a magic memoising function that efficiently looks up market prices (exchange rates) from one commodity to another (or if unspecified, to a default valuation commodity) on a given date. hledger-libA snapshot of the known exchange rates between commodity pairs at a given date, as a graph allowing fast lookup and path finding, along with some helper data. hledger-libA directed graph of exchange rates between commodity pairs. Node labels are commodities and edge labels are exchange rates, which were either: declared by P directives, inferred from transaction prices, inferred by reversing a declared rate, or inferred by reversing a transaction-inferred rate. There will be at most one edge between each directed pair of commodities, eg there can be one USD->EUR and one EUR->USD. hledger-lib/Mapping of graph node ids to commodity symbols. hledger-lib,The default valuation commodity for each source commodity. These are used when a valuation commodity is not specified (-V). They are the destination commodity of the latest (declared or inferred, but not reverse) each source commodity's latest market price (on the date of this graph). hledger-libeWhat kind of value conversion should be done on amounts ? CLI: --value=cost|then|end|now|DATE[,COMM] hledger-libzconvert to cost commodity using transaction prices, then optionally to given commodity using market prices at posting date hledger-lib[convert to default or given valuation commodity, using market prices at each posting's date hledger-libUconvert to default or given valuation commodity, using market prices at period end(s) hledger-libLconvert to default or given valuation commodity, using current market prices hledger-libQconvert to default or given valuation commodity, using market prices on some date hledger-libLworks like AtNow in single period reports, like AtEnd in multiperiod reports hledger-libmGenerate a price oracle (memoising price lookup function) from a journal's directive-declared and transaction-inferred market prices. For best performance, generate this only once per journal, reusing it across reports if there are more than one, as compoundBalanceCommand does. The boolean argument is whether to infer market prices from transactions or not. hledger-libApply a specified valuation to this mixed amount, using the provided price oracle, commodity styles, reference dates, and whether this is for a multiperiod report or not. See amountApplyValuation. hledger-libApply a specified valuation to this amount, using the provided price oracle, reference dates, and whether this is for a multiperiod report or not. Also fix up its display style using the provided commodity styles.When the valuation requires converting to another commodity, a valuation (conversion) date is chosen based on the valuation type, the provided reference dates, and whether this is for a single-period or multi-period report. It will be one of:Ea fixed date specified by the ValuationType itself (--value=DATE).the provided "period end" date - this is typically the last day of a subperiod (--value=end with a multi-period report), or of the specified report period or the journal (--value=end with a single-period report).wthe provided "report end" date - the last day of the specified report period, if any (-V/-X with a report end date).Nthe provided "today" date - (--value=now, or -V/X with no report end date).rNote --value=then is not supported by this function, and will cause an error; use postingApplyValuation for that.9This is all a bit complicated. See the reference doc at  ?https://hledger.org/hledger.html#effect-of-valuation-on-reportsF (hledger_options.m4.md "Effect of valuation on reports"), and #1083. hledger-lib@Standard error message for a report not supporting --value=then. hledger-lib!Find the market value of each component amount in the given commodity, or its default valuation commodity, at the given valuation date, using the given market price oracle. When market prices available on that date are not sufficient to calculate the value, amounts are left unchanged. hledger-lib Find the market value of this amount in the given valuation commodity if any, otherwise the default valuation commodity, at the given valuation date. (The default valuation commodity is the commodity of the latest applicable market price before the valuation date.)The returned amount will have its commodity's canonical style applied, but with the precision adjusted to show all significant decimal digits up to a maximum of 8. (experimental)vIf the market prices available on that date are not sufficient to calculate this value, the amount is left unchanged. hledger-libGiven a memoising price graph generator, a valuation date, a source commodity and an optional valuation commodity, find the value on that date of one unit of the source commodity in the valuation commodity, or in a default valuation commodity. Returns the valuation commodity that was specified or chosen, and the quantity of it that one unit of the source commodity is worth. Or if no applicable market price can be found or calculated, or if the source commodity and the valuation commodity are the same, returns Nothing.See makePriceGraph for how prices are determined. Note that both market prices and default valuation commodities can vary with valuation date, since that determines which market prices are visible. hledger-lib3Build the graph of commodity conversion prices for a given day. Converts a list of declared market prices in parse order, and a list of transaction-inferred market prices in parse order, to a graph of all known exchange rates between commodity pairs in effect on that day. Cf hledger.m4.md -> Valuation:hledger looks for a market price (exchange rate) from commodity A to commodity B in one or more of these ways, in this order of preference: A *declared market price* or *inferred market price*: A's latest market price in B on or before the valuation date as declared by a P directive, or (with the `--infer-value`, flag) inferred from transaction prices.]A *reverse market price*: the inverse of a declared or inferred market price from B to A.A *chained market price*: a synthetic price formed by combining the shortest chain of market prices (any of the above types) leading from A to B.k1 and 2 form the edges of the price graph, and we can query it for 3 (which is the reason we use a graph).We also identify each commodity's default valuation commodity, if any. For each commodity A, hledger picks a default valuation commodity as follows, in this order of preference: `The price commodity from the latest declared market price for A on or before valuation date.The price commodity from the latest declared market price for A on any date. (Allows conversion to proceed if there are inferred prices before the valuation date.)IIf there are no P directives at all (any commodity or date), and the `--infer-value`p flag is used, then the price commodity from the latest transaction price for A on or before valuation date. hledger-libaGiven a list of P-declared market prices in parse order and a list of transaction-inferred market prices in parse order, select just the latest prices that are in effect for each commodity pair. That is, for each commodity pair, the latest price by date then parse order, with declared prices having precedence over inferred prices on the same day. hledger-libLook up an existing graph node by its label. (If the node does not exist, a new one will be generated, but not persisted in the nodemap.) hledger-libConvert a valid path within the given graph to the corresponding edge labels. When there are multiple edges between two nodes, the lowest-sorting label is used. hledger-lib;Convert a path to node pairs representing the path's edges. hledger-lib~Get the label of a graph edge from one node to another. When there are multiple such edges, the lowest-sorting label is used.None  hledger-libDTruncate all account name components but the last to two characters. hledger-libwA top-level account prefixed to some accounts in budget reports. Defined here so it can be ignored by accountNameDrop. hledger-libcRemove some number of account name components from the front of the account name. If the special " unbudgetedc" top-level account is present, it is preserved and dropping affects the rest of the account name. hledger-libSorted unique account names implied by these account names, ie these plus all their parent accounts up to the root. Eg: ["a:b:c","d:e"] -> ["a","a:b","a:b:c","d","d:e"] hledger-lib"a:b:c" -> ["a","a:b","a:b:c"] hledger-lib  "a:b:c","d:e" -> ["a","d"] hledger-libUIs the first account a parent or other ancestor of (and not the same as) the second ? hledger-libcFrom a list of account names, select those which are direct subaccounts of the given account name. hledger-lib*Convert a list of account names to a tree. hledger-libOElide an account name to fit in the specified width. From the ledger 2.6 news: ] What Ledger now does is that if an account name is too long, it will start abbreviating the first parts of the account name down to two letters in length. If this results in a string that is still too long, the front will be elided -- not the end. For example: Expenses:Cash ; OK, not too long Ex:Wednesday:Cash ; Expenses6 was abbreviated to fit Ex:We:Afternoon:Cash ; Expenses and  Wednesday abbreviated ; Expenses:Wednesday:Afternoon:Lunch:Snack:Candy:Chocolate:Cash ..:Af:Lu:Sn:Ca:Ch:Cash ; Abbreviated and elided!  hledger-libKeep only the first n components of an account name, where n is a positive integer. If n is Just 0, returns the empty string, if n is Nothing, return the full name. hledger-libKeep only the first n components of an account name, where n is a positive integer. If n is Just 0, returns "...", if n is Nothing, return the full name. hledger-lib\Escape an AccountName for use within a regular expression. >>> putStr $ escapeName "First?! $*?$(*) !@^*? %)*!#" First?!#$*?$(*) !^ \*\? %\)\*!@ hledger-libPConvert an account name to a regular expression matching it and its subaccounts. hledger-libTConvert an account name to a regular expression matching it but not its subaccounts.          None>HVWֳ  hledger-libAn id identifying which report item field to interpolate. These are drawn from several hledger report types, so are not all applicable for a given report.! hledger-lib/A posting or balance report item's account name" hledger-lib1A posting or register or entry report item's date# hledger-lib8A posting or register or entry report item's description$ hledger-lib`A balance or posting report item's balance or running total. Always rendered right-justified.% hledger-libA balance report item's indent level (which may be different from the account name depth). Rendered as this number of spaces, multiplied by the minimum width spec if any.& hledger-lib0A report item's nth field. May be unimplemented.( hledger-lib!Literal text to be rendered as-is) hledger-lib:A data field to be formatted and interpolated. Parameters:'Left justify ? Right justified if false:Minimum width ? Will be space-padded if narrower than this2Maximum width ? Will be clipped if wider than this?Which of the standard hledger report item fields to interpolate* hledger-libQA format specification/template to use when rendering a report line item as text.A format is a sequence of components; each is either a literal string, or a hledger report item field with specified width and justification whose value will be interpolated at render time.A component's value may be a multi-line string (or a multi-commodity amount), in which case the final string will be either single-line or a top or bottom-aligned multi-line string depending on the StringFormat variant used.yCurrently this is only used in the balance command's single-column mode, which provides a limited StringFormat renderer.+ hledger-lib?multi-line values will be rendered on one line, comma-separated, hledger-libAvalues will be top-aligned (and bottom-padded to the same height)- hledger-lib.values will be bottom-aligned (and top-padded). hledger-lib=Parse a string format specification, or return a parse error. !"#$%&'()*+,-./0./*+,-'() !"#$%&0None >HVWXD&8 hledger-libURender a datespan as a display string, abbreviating into a compact form if possible.9 hledger-libbLike showDateSpan, but show month spans as just the abbreviated month name in the current locale.: hledger-libGet the current local date.; hledger-lib#Get the current local month number.< hledger-libGet the current local year.B hledger-lib5Get the 0-2 years mentioned explicitly in a DateSpan.C hledger-lib?Get overall span enclosing multiple sequentially ordered spans.D hledger-libSplit a DateSpan into consecutive whole spans of the specified interval which fully encompass the original span (and a little more when necessary). If no interval is specified, the original span is returned. If the original span is the null date span, ie unbounded, the null date span is returned. If the original span is empty, eg if the end date is <= the start date, no spans are returned. Examples:rlet t i y1 m1 d1 y2 m2 d2 = splitSpan i $ DateSpan (Just $ fromGregorian y1 m1 d1) (Just $ fromGregorian y2 m2 d2)"t NoInterval 2008 01 01 2009 01 01[DateSpan 2008]$t (Quarters 1) 2008 01 01 2009 01 01A[DateSpan 2008Q1,DateSpan 2008Q2,DateSpan 2008Q3,DateSpan 2008Q4]#splitSpan (Quarters 1) nulldatespan [DateSpan ..]6t (Days 1) 2008 01 01 2008 01 01 -- an empty datespan[]$t (Quarters 1) 2008 01 01 2008 01 01[]"t (Months 1) 2008 01 01 2008 04 014[DateSpan 2008-01,DateSpan 2008-02,DateSpan 2008-03]"t (Months 2) 2008 01 01 2008 04 01A[DateSpan 2008-01-01..2008-02-29,DateSpan 2008-03-01..2008-04-30]!t (Weeks 1) 2008 01 01 2008 01 15F[DateSpan 2007-12-31W01,DateSpan 2008-01-07W02,DateSpan 2008-01-14W03]!t (Weeks 2) 2008 01 01 2008 01 15A[DateSpan 2007-12-31..2008-01-13,DateSpan 2008-01-14..2008-01-27]&t (DayOfMonth 2) 2008 01 01 2008 04 01[DateSpan 2007-12-02..2008-01-01,DateSpan 2008-01-02..2008-02-01,DateSpan 2008-02-02..2008-03-01,DateSpan 2008-03-02..2008-04-01],t (WeekdayOfMonth 2 4) 2011 01 01 2011 02 15a[DateSpan 2010-12-09..2011-01-12,DateSpan 2011-01-13..2011-02-09,DateSpan 2011-02-10..2011-03-09]%t (DayOfWeek 2) 2011 01 01 2011 01 15a[DateSpan 2010-12-28..2011-01-03,DateSpan 2011-01-04..2011-01-10,DateSpan 2011-01-11..2011-01-17])t (DayOfYear 11 29) 2011 10 01 2011 10 15![DateSpan 2010-11-29..2011-11-28])t (DayOfYear 11 29) 2011 12 01 2012 12 15A[DateSpan 2011-11-29..2012-11-28,DateSpan 2012-11-29..2013-11-28]E hledger-libDCount the days in a DateSpan, or if it is open-ended return Nothing. hledger-libPIs this an empty span, ie closed with the end date on or before the start date ?F hledger-lib&Does the span include the given date ?G hledger-libGDoes the period include the given date ? (Here to avoid import cycle).H hledger-lib4Calculate the intersection of a number of datespans.I hledger-lib,Calculate the intersection of two datespans.For non-intersecting spans, gives an empty span beginning on the second's start date: >>> DateSpan (Just $ fromGregorian 2018 01 01) (Just $ fromGregorian 2018 01 03) In DateSpan (Just $ fromGregorian 2018 01 03) (Just $ fromGregorian 2018 01 05) DateSpan 2018-01-03..2018-01-02J hledger-librFill any unspecified dates in the first span with the dates from the second one. Sort of a one-way spanIntersect.K hledger-lib-Calculate the union of a number of datespans.L hledger-lib%Calculate the union of two datespans.M hledger-libCalculate the minimal DateSpan containing all of the given Days (in the usual exclusive-end-date sense: beginning on the earliest, and ending on the day after the latest).N hledger-libTSelect the DateSpan containing a given Day, if any, from a given list of DateSpans.If the DateSpans are non-overlapping, this returns the unique containing DateSpan, if it exists. If the DateSpans are overlapping, it will return the containing DateSpan with the latest start date, and then latest end date.O hledger-libzParse a period expression to an Interval and overall DateSpan using the provided reference date, or return a parse error.P hledger-lib1Like parsePeriodExpr, but call error' on failure. hledger-libShow a DateSpan as a human-readable pseudo-period-expression string. dateSpanAsText :: DateSpan -> String dateSpanAsText (DateSpan Nothing Nothing) = "all" dateSpanAsText (DateSpan Nothing (Just e)) = printf "to %s" (show e) dateSpanAsText (DateSpan (Just b) Nothing) = printf "from %s" (show b) dateSpanAsText (DateSpan (Just b) (Just e)) = printf "%s to %s" (show b) (show e)#Convert a single smart date string to a date span using the provided reference date, or raise an error. spanFromSmartDateString :: Day -> String -> DateSpan spanFromSmartDateString refdate s = spanFromSmartDate refdate sdate where sdate = fromparse $ parsewith smartdateonly sR hledger-libsConvert a smart date string to an explicit yyyy/mm/dd string using the provided reference date, or raise an error.S hledger-lib"A safe version of fixSmartDateStr.U hledger-libJConvert a SmartDate to an absolute date using the provided reference date. Examples: :set -XOverloadedStrings2let t = fixSmartDateStr (fromGregorian 2008 11 26)t "0000-01-01" "0000-01-01"t "1999-12-02" "1999-12-02"t "1999.12.02" "1999-12-02" t "1999/3/2" "1999-03-02" t "19990302" "1999-03-02" t "2008/2" "2008-02-01" t "0020/2" "0020-02-01"t "1000" "1000-01-01"t "4/2" "2008-04-02"t "2" "2008-11-02" t "January" "2008-01-01"t "feb" "2008-02-01" t "today" "2008-11-26" t "yesterday" "2008-11-25" t "tomorrow" "2008-11-27" t "this day" "2008-11-26" t "last day" "2008-11-25" t "next day" "2008-11-27"t "this week" -- last monday "2008-11-24"!t "last week" -- previous monday "2008-11-17"t "next week" -- next monday "2008-12-01"t "this month" "2008-11-01"t "last month" "2008-10-01"t "next month" "2008-12-01"t "this quarter" "2008-10-01"t "last quarter" "2008-07-01"t "next quarter" "2009-01-01" t "this year" "2008-01-01" t "last year" "2007-01-01" t "next year" "2009-01-01"Yt "last wed" "2008-11-19" t "next friday" "2008-11-28" t "next january" "2009-01-01" hledger-libFor given date d find year-long interval that starts on given MM/DD of year and covers it. The given MM and DD should be basically valid (1-12 & 1-31), or an error is raised.Examples: lets take 2017-11-22. Year-long intervals covering it that starts before Nov 22 will start in 2017. However intervals that start after Nov 23rd should start in 2016: >>> let wed22nd = fromGregorian 2017 11 22 >>> nthdayofyearcontaining 11 21 wed22nd 2017-11-21 >>> nthdayofyearcontaining 11 22 wed22nd 2017-11-22 >>> nthdayofyearcontaining 11 23 wed22nd 2016-11-23 >>> nthdayofyearcontaining 12 02 wed22nd 2016-12-02 >>> nthdayofyearcontaining 12 31 wed22nd 2016-12-31 >>> nthdayofyearcontaining 1 1 wed22nd 2017-01-01 hledger-libFor given date d find month-long interval that starts on nth day of month and covers it. The given day of month should be basically valid (1-31), or an error is raised.Examples: lets take 2017-11-22. Month-long intervals covering it that start on 1st-22nd of month will start in Nov. However intervals that start on 23rd-30th of month should start in Oct: >>> let wed22nd = fromGregorian 2017 11 22 >>> nthdayofmonthcontaining 1 wed22nd 2017-11-01 >>> nthdayofmonthcontaining 12 wed22nd 2017-11-12 >>> nthdayofmonthcontaining 22 wed22nd 2017-11-22 >>> nthdayofmonthcontaining 23 wed22nd 2017-10-23 >>> nthdayofmonthcontaining 30 wed22nd 2017-10-30 hledger-libWFor given date d find week-long interval that starts on nth day of week and covers it.Examples: 2017-11-22 is Wed. Week-long intervals that cover it and start on Mon, Tue or Wed will start in the same week. However intervals that start on Thu or Fri should start in prev week: >>> let wed22nd = fromGregorian 2017 11 22 >>> nthdayofweekcontaining 1 wed22nd 2017-11-20 >>> nthdayofweekcontaining 2 wed22nd 2017-11-21 >>> nthdayofweekcontaining 3 wed22nd 2017-11-22 >>> nthdayofweekcontaining 4 wed22nd 2017-11-16 >>> nthdayofweekcontaining 5 wed22nd 2017-11-17  hledger-lib]For given date d find month-long interval that starts on nth weekday of month and covers it.Examples: 2017-11-22 is 3rd Wed of Nov. Month-long intervals that cover it and start on 1st-4th Wed will start in Nov. However intervals that start on 4th Thu or Fri or later should start in Oct: >>> let wed22nd = fromGregorian 2017 11 22 >>> nthweekdayofmonthcontaining 1 3 wed22nd 2017-11-01 >>> nthweekdayofmonthcontaining 3 2 wed22nd 2017-11-21 >>> nthweekdayofmonthcontaining 4 3 wed22nd 2017-11-22 >>> nthweekdayofmonthcontaining 4 4 wed22nd 2017-10-26 >>> nthweekdayofmonthcontaining 4 5 wed22nd 2017-10-27  hledger-libBAdvance to nth weekday wd after given start day s Can call error.W hledger-lib/Try to parse a couple of date string formats:  `YYYY-MM-DD`,  `YYYY/MM/DD` or 56{, with leading zeros required. For internal use, not quite the same as the journal's "simple dates". >>> parsedateM "200802*03" Just 2008-02-03 >>> parsedateM "200802#03/" Nothing >>> parsedateM "200802 30" NothingX hledger-libParse a date in any of the formats allowed in Ledger's period expressions, and some others. Assumes any text in the parse stream has been lowercased. Returns a SmartDate, to be converted to a full date later (see fixSmartDate). Examples:  2004 (start of year, which must have 4+ digits) 2004/10 (start of month, which must be 1-12) 2004/10/1 (exact date, day must be 1-31) 10/1 (month and day in current year) 21 (day in current month) october, oct (start of month in current year) yesterday, today, tomorrow (-1, 0, 1 days from today) last/this/next day/week/month/quarter/year (-1, 0, 1 periods from the current period) 20181201 (8 digit YYYYMMDD with valid year month and day) 201812 (6 digit YYYYMM with valid year and month)=Note malformed digit sequences might give surprising results: 201813 (6 digits with an invalid month is parsed as start of 6-digit year) 20181301 (8 digits with an invalid month is parsed as start of 8-digit year) 20181232 (8 digits with an invalid day gives an error) 201801012 (9+ digits beginning with a valid YYYYMMDD gives an error)Eg:YYYYMMDD is parsed as year-month-date if those parts are valid (>=4 digits, 1-12, and 1-31 respectively): >>> parsewith (smartdate <* eof) "20181201" Right (SmartAssumeStart 2018 (Just (12,Just 1)))YYYYMM is parsed as year-month-01 if year and month are valid: >>> parsewith (smartdate <* eof) "201804" Right (SmartAssumeStart 2018 (Just (4,Nothing)))With an invalid month, it's parsed as a year: >>> parsewith (smartdate <* eof) "201813" Right (SmartAssumeStart 201813 Nothing)wA 9+ digit number beginning with valid YYYYMMDD gives an error: >>> parsewith (smartdate <* eof) "201801012" Left (...)Big numbers not beginning with a valid YYYYMMDD are parsed as a year: >>> parsewith (smartdate <* eof) "201813012" Right (SmartAssumeStart 201813012 Nothing)  hledger-libOLike smartdate, but there must be nothing other than whitespace after the date.\ hledger-libQParse a year number from a Text, making sure that at least four digits are used.] hledger-libParse a period expression, specifying a date span and optionally a reporting interval. Requires a reference "today" date for resolving any relative start/end dates (only; it is not needed for parsing the reporting interval).2let p = parsePeriodExpr (fromGregorian 2008 11 26)p "from Aug to Oct"2Right (NoInterval,DateSpan 2008-08-01..2008-09-30)p "aug to oct"2Right (NoInterval,DateSpan 2008-08-01..2008-09-30) p "2009q2""Right (NoInterval,DateSpan 2009Q2)p "Q3""Right (NoInterval,DateSpan 2008Q3)p "every 3 days in Aug"Right (Days 3,DateSpan 2008-08)p "daily from aug"$Right (Days 1,DateSpan 2008-08-01..)p "every week to 2009"%Right (Weeks 1,DateSpan ..2008-12-31)p "every 2nd day of month" Right (DayOfMonth 2,DateSpan ..)p "every 2nd day" Right (DayOfMonth 2,DateSpan ..)p "every 2nd day 2009.."*Right (DayOfMonth 2,DateSpan 2009-01-01..)p "every 2nd day 2009-"*Right (DayOfMonth 2,DateSpan 2009-01-01..)p "every 29th Nov"#Right (DayOfYear 11 29,DateSpan ..)p "every 29th nov ..2009"-Right (DayOfYear 11 29,DateSpan ..2008-12-31)p "every nov 29th"#Right (DayOfYear 11 29,DateSpan ..)p "every Nov 29th 2009.."-Right (DayOfYear 11 29,DateSpan 2009-01-01..)p "every 11/29 from 2009"-Right (DayOfYear 11 29,DateSpan 2009-01-01..)'p "every 2nd Thursday of month to 2009"0Right (WeekdayOfMonth 2 4,DateSpan ..2008-12-31)%p "every 1st monday of month to 2009"0Right (WeekdayOfMonth 1 1,DateSpan ..2008-12-31) p "every tue"Right (DayOfWeek 2,DateSpan ..)p "every 2nd day of week"Right (DayOfWeek 2,DateSpan ..)p "every 2nd day of month" Right (DayOfMonth 2,DateSpan ..)p "every 2nd day" Right (DayOfMonth 2,DateSpan ..)p "every 2nd day 2009.."*Right (DayOfMonth 2,DateSpan 2009-01-01..)!p "every 2nd day of month 2009.."*Right (DayOfMonth 2,DateSpan 2009-01-01..)  hledger-libOparsewith (doubledatespanp (fromGregorian 2018 01 01) <* eof) "20180101-201804"Right DateSpan 2018Q1  hledger-libCparsewith (quarterdatespanp (fromGregorian 2018 01 01) <* eof) "q1"Right DateSpan 2018Q1Cparsewith (quarterdatespanp (fromGregorian 2018 01 01) <* eof) "Q1"Right DateSpan 2018Q1Gparsewith (quarterdatespanp (fromGregorian 2018 01 01) <* eof) "2020q4"Right DateSpan 2020Q4_ hledger-lib0A datespan of zero length, that matches no date.*789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`*:;<`FGW789=V]OP^_ZY[>?@ABCIHJLKMNXDURST\EQNoneHd hledger-libMake a posting to an account.e hledger-lib2Make a virtual (unbalanced) posting to an account.f hledger-lib=Make a posting to an account, maybe with a balance assertion.g hledger-libRMake a virtual (unbalanced) posting to an account, maybe with a balance assertion.j hledger-lib,Make a partial, exclusive balance assertion.k hledger-lib*Make a total, exclusive balance assertion.l hledger-lib,Make a partial, inclusive balance assertion.m hledger-lib*Make a total, inclusive balance assertion.v hledger-lib9Sorted unique account names referenced by these postings.x hledger-libRemove all prices of a postingy hledger-libGet a posting's (primary) date - it's own primary date if specified, otherwise the parent transaction's primary date, or the null date if there is no parent transaction.z hledger-libGet a posting's secondary (secondary) date, which is the first of: posting's secondary date, transaction's secondary date, posting's primary date, transaction's primary date, or the null date if there is no parent transaction.{ hledger-libSGet a posting's status. This is cleared or pending if those are explicitly set on the posting, otherwise the status of its parent transaction, or unmarked if there is no parent transaction. (Note the ambiguity, unmarked can mean "posting and transaction are both unmarked" or "posting is unmarked and don't know about the transaction".| hledger-libJTags for this posting including any inherited from its parent transaction.} hledger-lib:Tags for this transaction including any from its postings. hledger-lib3Does this posting fall within the given date span ? hledger-lib`Prefix one account name to another, preserving posting type indicators like concatAccountNames. hledger-libJoin account names into one. If any of them has () or [] posting type indicators, these (the first type encountered) will also be applied to the resulting account name. hledger-libRewrite an account name using all matching aliases from the given list, in sequence. Each alias sees the result of applying the previous aliases. Or, return any error arising from a bad regular expression in the aliases. hledger-lib=Memoising version of accountNameApplyAliases, maybe overkill. hledger-libApply a specified valuation to this posting's amount, using the provided price oracle, commodity styles, reference dates, and whether this is for a multiperiod report or not. See amountApplyValuation. hledger-libOConvert this posting's amount to cost, and apply the appropriate amount styles. hledger-lib Convert this posting's amount to market value in the given commodity, or the default valuation commodity, at the given valuation date, using the given market price oracle. When market prices available on that date are not sufficient to calculate the value, amounts are left unchanged. hledger-lib4Apply a transform function to this posting's amount. hledger-libJoin two parts of a comment, eg a tag and another tag, or a tag and a non-tag, on a single line. Interpolates a comma and space unless one of the parts is empty. hledger-lib{Add a tag to a comment, comma-separated from any prior content. A space is inserted following the colon, before the value. hledger-libAdd a tag on its own line to a comment, preserving any prior content. A space is inserted following the colon, before the value..bcdefghijklmnopqrstuvwxyz{|}~.bcdefghijklmn{qrsut|}~xyzvwopNone"#>SX_ hledger-libRender source position in human-readable form. Keep in sync with Hledger.UI.ErrorScreen.hledgerparseerrorpositionp (temporary). XXX hledger-lib;Make a simple transaction with the given date and postings. hledger-libParse a transaction's description into payee and note (aka narration) fields, assuming a convention of separating these with | (like Beancount). Ie, everything up to the first | is the payee, everything after it is the note. When there's no |, payee == note == description. hledger-libTRender a journal transaction as text similar to the style of Ledger's print command.0Adapted from Ledger 2.x and 3.x standard format: yyyy-mm-dd[ *][ CODE] description......... [ ; comment...............] account name 1..................... ...$amount1[ ; comment...............] account name 2..................... ..$-amount1[ ; comment...............] pcodewidth = no limit -- 10 -- mimicking ledger layout. pdescwidth = no limit -- 20 -- I don't remember what these mean, pacctwidth = 35 minimum, no maximum -- they were important at the time. pamtwidth = 11 pcommentwidth = no limit -- 22 The output will be parseable journal syntax. To facilitate this, postings with explicit multi-commodity amounts are displayed as multiple similar postings, one per commodity. (Normally does not happen with this function). hledger-libDeprecated alias for  hledger-libLike showTransaction, but explicit multi-commodity amounts are shown on one line, comma-separated. In this case the output will not be parseable journal syntax. hledger-libDeprecated alias for  hledger-libHelper for showTransaction*. hledger-libRender a transaction or posting's comment as indented, semicolon-prefixed comment lines. The first line (unless empty) will have leading space, subsequent lines will have a larger indent. hledger-libIGiven a transaction and its postings, render the postings, suitable for  output. Normally this output will be valid journal syntax which hledger can reparse (though it may include no-longer-valid balance assertions).9Explicit amounts are shown, any implicit amounts are not.Postings with multicommodity explicit amounts are handled as follows: if onelineamounts is true, these amounts are shown on one line, comma-separated, and the output will not be valid journal syntax. Otherwise, they are shown as several similar postings, one per commodity.The output will appear to be a balanced transaction. Amounts' display precisions, which may have been limited by commodity directives, will be increased if necessary to ensure this.Posting amounts will be aligned with each other, starting about 4 columns beyond the widest account name (see postingAsLines for details). hledger-lib7Render one posting, on one or more lines, suitable for  output. There will be an indented account name, plus one or more of status flag, posting amount, balance assertion, same-line comment, next-line comments.RIf the posting's amount is implicit or if elideamount is true, no amount is shown.'If the posting's amount is explicit and multi-commodity, multiple similar postings are shown, one for each commodity, to help produce parseable journal syntax. Or if onelineamounts is true, such amounts are shown on one line, comma-separated (and the output will not be valid journal syntax).By default, 4 spaces (2 if there's a status flag) are shown between account name and start of amount area, which is typically 12 chars wide and contains a right-aligned amount (so 10-12 visible spaces between account name and amount is typical). When given a list of postings to be aligned with, the whitespace will be increased if needed to match the posting with the longest account name. This is used to align the amounts of a transaction's postings. hledger-libFRender a balance assertion, as the =[=][*] symbol and expected amount. hledger-libRender a posting, simply. Used in balance assertion errors. showPostingLine p = lineIndent $ if pstatus p == Cleared then "* " else "" ++ -- XXX show ! showAccountName Nothing (ptype p) (paccount p) ++ " " ++ showMixedAmountOneLine (pamount p) ++ assertion where -- XXX extract, handle == assertion = maybe "" ((" = " ++) . showAmountWithZeroCommodity . baamount) $ pbalanceassertion poRender a posting, at the appropriate width for aligning with its siblings if any. Used by the rewrite command. hledger-libNPrepend a suitable indent for a posting (or transaction/posting comment) line. hledger-lib6Prepend the space required before a same-line comment. hledger-libShow an account name, clipped to the given width if any, and appropriately bracketed/parenthesised for the given posting type. hledger-libCheck that this transaction would appear balanced to a human when displayed. On success, returns the empty list, otherwise one or more error messages.YIn more detail: For the real postings, and separately for the balanced virtual postings: &Convert amounts to cost where possible>When there are two or more non-zero amounts (appearing non-zero when displayed, using the given display styles if provided), are they a mix of positives and negatives ? This is checked separately to give a clearer error message. (Best effort; could be confused by postings with multicommodity amounts.)gDoes the amounts' sum appear non-zero when displayed ? (using the given display styles if provided) hledger-lib(Legacy form of transactionCheckBalanced. hledger-lib4Balance this transaction, ensuring that its postings (and its balanced virtual postings) sum to 0, by inferring a missing amount or conversion price(s) if needed. Or if balancing is not possible, because the amounts don't sum to 0 or because there's more than one missing amount, return an error message.Transactions with balance assignments can have more than one missing amount; to balance those you should use the more powerful journalBalanceTransactions.The "sum to 0" test is done using commodity display precisions, if provided, so that the result agrees with the numbers users can see. hledger-libHelper used by balanceTransaction and balanceTransactionWithBalanceAssignmentAndCheckAssertionsB; use one of those instead. It also returns a list of accounts and amounts that were inferred. hledger-libiGenerate a transaction balancing error message, given the transaction and one or more suberror messages. hledger-libInfer up to one missing amount for this transactions's real postings, and likewise for its balanced virtual postings, if needed; or return an error message if we can't. Returns the updated transaction and any inferred posting amounts, with the corresponding accounts, in order).We can infer a missing amount when there are multiple postings and exactly one of them is amountless. If the amounts had price(s) the inferred amount have the same price(s), and will be converted to the price commodity. hledger-lib Infer prices for this transaction's posting amounts, if needed to make the postings balance, and if possible. This is done once for the real postings and again (separately) for the balanced virtual postings. When it's not possible, the transaction is left unchanged.The simplest example is a transaction with two postings, each in a different commodity, with no prices specified. In this case we'll add a price to the first posting such that it can be converted to the commodity of the second posting (with -B), and such that the postings balance.&In general, we can infer a conversion price when the sum of posting amounts contains exactly two different commodities and no explicit prices. Also all postings are expected to contain an explicit amount (no missing amounts) in a single commodity. Otherwise no price inferring is attempted.The transaction itself could contain more than two commodities, and/or prices, if they cancel out; what matters is that the sum of posting amounts contains exactly two commodities and zero prices.FThere can also be more than two postings in either of the commodities.We want to avoid excessive display of digits when the calculated price is an irrational number, while hopefully also ensuring the displayed numbers make sense if the user does a manual calculation. This is (mostly) achieved in two ways:when there is only one posting in the "from" commodity, a total price (@@) is used, and all available decimal digits are shownotherwise, a suitable averaged unit price (@) is applied to the relevant postings, with display precision equal to the summed display precisions of the two commodities being converted between, or 2, whichever is larger.'(We don't always calculate a good-looking display precision for unit prices when the commodity display precisions are low, eg when a journal doesn't use any decimal places. The minimum of 2 helps make the prices shown by the print command a bit less surprising in this case. Could do better.) hledger-libGenerate a posting update function which assigns a suitable balancing price to the posting, if and as appropriate for the given transaction and posting type (real or balanced virtual). hledger-libZEnsure a transaction's postings refer back to it, so that eg relatedPostings works right. hledger-libqEnsure a transaction's postings do not refer back to it, so that eg recursiveSize and GHCI's :sprint work right. hledger-lib#Set a posting's parent transaction. hledger-lib9Apply a transform function to this transaction's amounts. hledger-libApply a specified valuation to this transaction's amounts, using the provided price oracle, commodity styles, reference dates, and whether this is for a multiperiod report or not. See amountApplyValuation. hledger-libTConvert this transaction's amounts to cost, and apply the appropriate amount styles. hledger-libcommodity display styles hledger-libcommodity display styles hledger-libcommodity display stylesNone%>M4 hledger-libA query option changes a query 's/report'#s behaviour and output in some way. hledger-lib1show an account register focussed on this account hledger-libas above but include sub-accounts in the account register | QueryOptCostBasis -- ^ show amounts converted to cost where possible | QueryOptDate2 -- ^ show secondary dates instead of primary dates hledger-lib|A more expressive Ord, used for amt: queries. The Abs* variants compare with the absolute value of a number, ignoring sign. hledger-libsA query is a composition of search criteria, which can be used to match postings, transactions, accounts and more. hledger-lib always match hledger-lib never match hledger-libnegate this match hledger-libmatch if any of these match hledger-libmatch if all of these match hledger-lib!match if code matches this regexp hledger-lib(match if description matches this regexp hledger-lib0match postings whose account matches this regexp hledger-lib'match if primary date in this date span hledger-lib)match if secondary date in this date span hledger-lib$match txns/postings with this status hledger-libJmatch if "realness" (involves a real non-virtual account ?) has this value hledger-lib3match if the amount's numeric quantity is less than greater than'equal to/unsignedly equal to some value hledger-lib>match if the entire commodity symbol is matched by this regexp hledger-libyif true, show zero-amount postings/accounts which are usually not shown more of a query option than a query criteria ? hledger-libmatch if account depth is less than or equal to this value. Depth is sometimes used like a query (for filtering report data) and sometimes like a query option (for controlling display) hledger-libmatch if a tag's name, and optionally its value, is matched by these respective regexps matching the regexp if provided, exists hledger-libConstruct a payee tag hledger-libConstruct a note tag hledger-lib%Construct a generated-transaction tag hledger-libConvert a query expression containing zero or more space-separated terms to a query and zero or more query options; or return an error message if query parsing fails.A query term is either: :a search pattern, which matches on one or more fields, eg:acct:REGEXP - match the account name with a regular expression desc:REGEXP - match the transaction description date:PERIODEXP - match the date with a period expression^The prefix indicates the field to match, or if there is no prefix account name is assumed. a query option, which modifies the reporting behaviour in some way. There is currently one of these, which may appear only once:inacct:FULLACCTNAMEThe usual shell quoting rules are assumed. When a pattern contains whitespace, it (or the whole term including prefix) should be enclosed in single or double quotes.ePeriod expressions may contain relative dates, so a reference date is required to fully parse these.Multiple terms are combined as follows: 1. multiple account patterns are OR'd together 2. multiple description patterns are OR'd together 3. multiple status patterns are OR'd together 4. then all terms are AND'd together)parseQuery nulldate "expenses:dining out"GRight (Or [Acct (RegexpCI "expenses:dining"),Acct (RegexpCI "out")],[])-parseQuery nulldate "\"expenses:dining out\""0Right (Acct (RegexpCI "expenses:dining out"),[]) hledger-libQuote-and-prefix-aware version of words - don't split on spaces which are inside quotes, including quotes which may have one of the specified prefixes in front, and maybe an additional not: prefix in front of that. hledger-liblParse a single query term as either a query or a query option, or return an error message if parsing fails.  hledger-libParse the argument of an amt query term ([OP][SIGN]NUM), to an OrdPlus and a Quantity, or if parsing fails, an error message. OP can be  =,<,=, >, or = . NUM can be a simple integer or decimal. If a decimal, the decimal mark must be period, and it must have digits preceding it. Digit group marks are not allowed.! hledger-lib>Parse the value part of a "status:" query, or return an error." hledger-libxParse the boolean value part of a "status:" query. "1" means true, anything else will be parsed as false without error. hledger-libRemove query terms (or whole sub-expressions) not matching the given predicate from this query. XXX Semantics not completely clear. hledger-lib"Does this query match everything ? hledger-libDoes this query specify a start date and nothing else (that would filter postings prior to the date) ? When the flag is true, look for a starting secondary date instead. hledger-libWhat start date (or secondary date) does this query specify, if any ? For OR expressions, use the earliest of the dates. NOT is ignored. hledger-libWhat end date (or secondary date) does this query specify, if any ? For OR expressions, use the latest of the dates. NOT is ignored. hledger-libWhat date span (or with a true argument, what secondary date span) does this query specify ? OR clauses specifying multiple spans return their union (the span enclosing all of them). AND clauses specifying multiple spans return their intersection. NOT clauses are ignored. hledger-libWhat date span does this query specify, treating primary and secondary dates as equivalent ? OR clauses specifying multiple spans return their union (the span enclosing all of them). AND clauses specifying multiple spans return their intersection. NOT clauses are ignored.# hledger-lib@What is the earliest of these dates, where Nothing is earliest ?$ hledger-lib>What is the latest of these dates, where Nothing is earliest ?% hledger-libBWhat is the earliest of these dates, where Nothing is the latest ?& hledger-lib@What is the latest of these dates, where Nothing is the latest ? hledger-lib3The depth limit this query specifies, if it has one hledger-lib~The account we are currently focussed on, if any, and whether subaccounts are included. Just looks at the first query option. hledger-libgA query for the account(s) we are currently focussed on, if any. Just looks at the first query option. hledger-libDoes the match expression match this account ? A matching in: clause is also considered a match. When matching by account name pattern, if there's a regular expression error, this function calls error. hledger-lib6Does the match expression match this (simple) amount ?' hledger-libIs this simple (single-amount) mixed amount's quantity less than, greater than, equal to, or unsignedly equal to this number ? For multi-amount (multiple commodities, or just unsimplified) mixed amounts this is always true.aIs this amount's quantity less than, greater than, equal to, or unsignedly equal to this number ? hledger-lib.Does the match expression match this posting ?FNote that for account match we try both original and effective account hledger-lib2Does the match expression match this transaction ? hledger-libMDoes the query match the name and optionally the value of any of these tags ? hledger-lib(Does the query match this market price ?99None$% hledger-libApply all the given transaction modifiers, in turn, to each transaction. Or if any of them fails to be parsed, return the first error. A reference date is provided to help interpret relative dates in transaction modifier queries.( hledger-lib Converts a  to a -transforming function which applies the modification(s) specified by the TransactionModifier. Or, returns the error message there is a problem parsing the TransactionModifier's query. A reference date is provided to help interpret relative dates in the query.UThe postings of the transformed transaction will reference it in the usual way (ie,  is called).wCurrently the only kind of modification possible is adding automated postings when certain other postings are present.4t = nulltransaction{tpostings=["ping" `post` usd 1]}ctest = either putStr (putStr.showTransaction) . fmap ($ t) . transactionModifierToFunction nulldate3test $ TransactionModifier "" ["pong" `post` usd 2] 0000-01-01 ping $1.000 pong $2.00 ; generated-posting: =7test $ TransactionModifier "miss" ["pong" `post` usd 2] 0000-01-01 ping $1.00Ytest $ TransactionModifier "ping" ["pong" `post` amount{aismultiplier=True, aquantity=3}] 0000-01-01 ping $1.005 pong $3.00 ; generated-posting: = ping) hledger-lib Converts a TransactionModifier's posting rule to a 0-generating function, which will be used to make a new posting based on the old one (an "automated posting"). The new posting's amount can optionally be the old posting's amount multiplied by a constant. If the old posting had a total-priced amount, the new posting's multiplied amount will be unit-priced. The new posting will have two tags added: a normal generated-posting: tag which also appears in the comment, and a hidden _generated-posting: tag which does not. The TransactionModifier's query text is also provided, and saved as the tags' value.None hledger-libConvert time log entries to journal transactions. When there is no clockout, add one with the provided current time. Sessions crossing midnight are split into days to give accurate per-day totals.* hledger-libConvert a timeclock clockin and clockout entry to an equivalent journal transaction, representing the time expenditure. Note this entry is not balanced, since we omit the "assets:time" transaction for simpler output.None"#G hledger-lib@Derive 1. an account tree and 2. each account's total exclusive and inclusive changes from a list of postings. This is the core of the balance command (and of *ledger). The accounts are returned as a list in flattened tree order, and also reference each other as a tree. (The first account is the root of the tree.) hledger-libConvert a list of account names to a tree of Account objects, with just the account names filled in. A single root account with the given name is added. hledger-lib;Tie the knot so all subaccounts' parents are set correctly. hledger-libDGet this account's parent accounts, from the nearest up to the root. hledger-lib4List the accounts at each level of the account tree. hledger-libIMap a (non-tree-structure-modifying) function over this and sub accounts. hledger-libAIs the predicate true on any of this account or its subaccounts ? hledger-lib5Add subaccount-inclusive balances to an account tree. hledger-lib-Remove all subaccounts below a certain depth. hledger-libRemove subaccounts below the specified depth, aggregating their balance at the depth limit (accounts at the depth limit will have any sub-balances merged into their exclusive balance). If the depth is Nothing, return the original accounts hledger-lib;Remove all leaf accounts and subtrees matching a predicate. hledger-libFlatten an account tree into a list, which is sometimes convenient. Note since accounts link to their parents/subs, the tree's structure remains intact and can still be used. It's a tree/list! hledger-lib#Filter an account tree (to a list). hledger-libgSort each group of siblings in an account tree by inclusive amount, so that the accounts with largest normal balances are listed first. The provided normal balance sign determines whether normal balances are negative or positive, affecting the sort order. Ie, if balances are normally negative, then the most negative balances sort first, and vice versa. hledger-lib|Add extra info for this account derived from the Journal's account directives, if any (comment, tags, declaration order..). hledger-libSort account names by the order in which they were declared in the journal, at each level of the account tree (ie within each group of siblings). Undeclared accounts are sorted last and alphabetically. This is hledger's default sort for reports organised by account. The account list is converted to a tree temporarily, adding any missing parents; these can be kept (suitable for a tree-mode report) or removed (suitable for a flat-mode report). hledger-libSort each group of siblings in an account tree by declaration order, then account name. So each group will contain first the declared accounts, in the same order as their account directives were parsed, and then the undeclared accounts, sorted by account name. hledger-libSearch an account list by name.    None"#  hledger-libGenerate transactions from  within a #Note that new transactions require  post-processing. The new transactions will have three tags added: - a recur:PERIODICEXPR tag whose value is the generating periodic expression - a generated-transaction: tag - a hidden _generated-transaction: tag which does not appear in the comment.  import Data.Time (fromGregorian)&_ptgen "monthly from 2017/1 to 2017/4" 2017-01-01< ; generated-transaction: ~ monthly from 2017/1 to 2017/4 a $1.00 2017-02-01< ; generated-transaction: ~ monthly from 2017/1 to 2017/4 a $1.00 2017-03-01< ; generated-transaction: ~ monthly from 2017/1 to 2017/4 a $1.00&_ptgen "monthly from 2017/1 to 2017/5" 2017-01-01< ; generated-transaction: ~ monthly from 2017/1 to 2017/5 a $1.00 2017-02-01< ; generated-transaction: ~ monthly from 2017/1 to 2017/5 a $1.00 2017-03-01< ; generated-transaction: ~ monthly from 2017/1 to 2017/5 a $1.00 2017-04-01< ; generated-transaction: ~ monthly from 2017/1 to 2017/5 a $1.007_ptgen "every 2nd day of month from 2017/02 to 2017/04" 2017-01-02M ; generated-transaction: ~ every 2nd day of month from 2017/02 to 2017/04 a $1.00 2017-02-02M ; generated-transaction: ~ every 2nd day of month from 2017/02 to 2017/04 a $1.00 2017-03-02M ; generated-transaction: ~ every 2nd day of month from 2017/02 to 2017/04 a $1.006_ptgen "every 30th day of month from 2017/1 to 2017/5" 2016-12-30L ; generated-transaction: ~ every 30th day of month from 2017/1 to 2017/5 a $1.00 2017-01-30L ; generated-transaction: ~ every 30th day of month from 2017/1 to 2017/5 a $1.00 2017-02-28L ; generated-transaction: ~ every 30th day of month from 2017/1 to 2017/5 a $1.00 2017-03-30L ; generated-transaction: ~ every 30th day of month from 2017/1 to 2017/5 a $1.00 2017-04-30L ; generated-transaction: ~ every 30th day of month from 2017/1 to 2017/5 a $1.00:_ptgen "every 2nd Thursday of month from 2017/1 to 2017/4" 2016-12-08P ; generated-transaction: ~ every 2nd Thursday of month from 2017/1 to 2017/4 a $1.00 2017-01-12P ; generated-transaction: ~ every 2nd Thursday of month from 2017/1 to 2017/4 a $1.00 2017-02-09P ; generated-transaction: ~ every 2nd Thursday of month from 2017/1 to 2017/4 a $1.00 2017-03-09P ; generated-transaction: ~ every 2nd Thursday of month from 2017/1 to 2017/4 a $1.00)_ptgen "every nov 29th from 2017 to 2019" 2016-11-29? ; generated-transaction: ~ every nov 29th from 2017 to 2019 a $1.00 2017-11-29? ; generated-transaction: ~ every nov 29th from 2017 to 2019 a $1.00 2018-11-29? ; generated-transaction: ~ every nov 29th from 2017 to 2019 a $1.00_ptgen "2017/1" 2017-01-01% ; generated-transaction: ~ 2017/1 a $1.00 _ptgen ""!*** Exception: failed to parse......_ptgen "weekly from 2017"*** Exception: Unable to generate transactions according to "weekly from 2017" because 2017-01-01 is not a first day of the Week_ptgen "monthly from 2017/5/4"*** Exception: Unable to generate transactions according to "monthly from 2017/5/4" because 2017-05-04 is not a first day of the Month$_ptgen "every quarter from 2017/1/2"*** Exception: Unable to generate transactions according to "every quarter from 2017/1/2" because 2017-01-02 is not a first day of the Quarter_ptgen "yearly from 2017/1/14"*** Exception: Unable to generate transactions according to "yearly from 2017/1/14" because 2017-01-14 is not a first day of the Year3let reportperiod="daily from 2018/01/03" in let (i,s) = parsePeriodExpr' nulldate reportperiod in runPeriodicTransaction (nullperiodictransaction{ptperiodexpr=reportperiod, ptspan=s, ptinterval=i, ptpostings=["a" `post` usd 1]}) (DateSpan (Just $ fromGregorian 2018 01 01) (Just $ fromGregorian 2018 01 03))[]w_ptgenspan "every 3 months from 2019-05" (DateSpan (Just $ fromGregorian 2020 01 01) (Just $ fromGregorian 2020 02 01))w_ptgenspan "every 3 months from 2019-05" (DateSpan (Just $ fromGregorian 2020 02 01) (Just $ fromGregorian 2020 03 01)) 2020-02-01: ; generated-transaction: ~ every 3 months from 2019-05 a $1.00r_ptgenspan "every 3 days from 2018" (DateSpan (Just $ fromGregorian 2018 01 01) (Just $ fromGregorian 2018 01 05)) 2018-01-015 ; generated-transaction: ~ every 3 days from 2018 a $1.00 2018-01-045 ; generated-transaction: ~ every 3 days from 2018 a $1.00r_ptgenspan "every 3 days from 2018" (DateSpan (Just $ fromGregorian 2018 01 02) (Just $ fromGregorian 2018 01 05)) 2018-01-045 ; generated-transaction: ~ every 3 days from 2018 a $1.00 hledger-libCheck that this date span begins at a boundary of this interval, or return an explanatory error message including the provided period expression (from which the span and interval are derived).  None$1SX_EH+ hledger-lib:The state used while balancing a sequence of transactions., hledger-libcommodity display styles- hledger-lib5accounts in which balance assignments may not be used. hledger-lib,whether to check balance assertions mutable/ hledger-lib)running account balances, initially empty0 hledger-liba mutable array of the transactions being balanced (for efficiency ? journalBalanceTransactions says: not strictly necessary but avoids a sort at the end I think)1 hledger-lib#Monad used for statefully balancingamount-inferringassertion-checking a sequence of transactions. Perhaps can be simplified, or would a different ordering of layers make sense ? If you see a way, let us know. hledger-libWGet the transaction with this index (its 1-based position in the input stream), if any. hledger-libYGet the transaction that appeared immediately after this one in the input stream, if any. hledger-libZGet the transaction that appeared immediately before this one in the input stream, if any. hledger-lib5Unique transaction descriptions used in this journal. hledger-lib8All postings from this journal's transactions, in order. hledger-libESorted unique account names posted to by this journal's transactions. hledger-libSorted unique account names implied by this journal's transactions - accounts posted to and all their implied parent accounts. hledger-libKSorted unique account names declared by account directives in this journal. hledger-libiSorted unique account names declared by account directives or posted to by transactions in this journal.  hledger-libSorted unique account names declared by account directives, or posted to or implied as parents by transactions in this journal.! hledger-libIConvenience/compatibility alias for journalAccountNamesDeclaredOrImplied." hledger-libA query for accounts in this journal which have been declared as Asset (or Cash, a subtype of Asset) by account directives, or otherwise for accounts with names matched by the case-insensitive regular expression  ^assets?(:|$).# hledger-lib A query for Cash (liquid asset) accounts in this journal, ie accounts declared as Cash by account directives, or otherwise with names matched by the case-insensitive regular expression  ^assets?(:|$)=. and not including the case-insensitive regular expression #(investment|receivable|:A/R|:fixed).$ hledger-libA query for accounts in this journal which have been declared as Liability by account directives, or otherwise for accounts with names matched by the case-insensitive regular expression ^(debts?|liabilit(y|ies))(:|$).% hledger-libA query for accounts in this journal which have been declared as Equity by account directives, or otherwise for accounts with names matched by the case-insensitive regular expression  ^equity(:|$).& hledger-libA query for accounts in this journal which have been declared as Revenue by account directives, or otherwise for accounts with names matched by the case-insensitive regular expression ^(income|revenue)s?(:|$).' hledger-libA query for accounts in this journal which have been declared as Expense by account directives, or otherwise for accounts with names matched by the case-insensitive regular expression ^expenses?(:|$).( hledger-libDA query for Asset, Liability & Equity accounts in this journal. Cf  Ehttp://en.wikipedia.org/wiki/Chart_of_accounts#Balance_Sheet_Accounts.) hledger-lib8A query for Profit & Loss accounts in this journal. Cf  Ghttp://en.wikipedia.org/wiki/Chart_of_accounts#Profit_.26_Loss_accounts.2 hledger-libGet a query for accounts of the specified types (Asset, Liability..) in this journal. The query will match all accounts which were declared as one of these types by account directives, plus all their subaccounts which have not been declared as some other type. Or if no accounts were declared with these types, the query will instead match accounts with names matched by the provided case-insensitive regular expression.* hledger-lib5Keep only transactions matching the query expression.+ hledger-libZKeep only postings matching the query expression. This can leave unbalanced transactions., hledger-libnWithin each posting's amount, keep only the parts matching the query. This can leave unbalanced transactions.- hledger-lib|Filter out all parts of this transaction's amounts which do not match the query. This can leave the transaction unbalanced.. hledger-libKFilter out all parts of this posting's amount which do not match the query.0 hledger-lib3Apply a transformation to a journal's transactions.1 hledger-lib/Apply a transformation to a journal's postings.2 hledger-lib3Apply a transformation to a transaction's postings.3 hledger-libReverse all lists of parsed items, which during parsing were prepended to, so that the items are in parse order. Part of post-parse finalisation.4 hledger-libDSet this journal's last read time, ie when its files were last read.3 hledger-libRNumber (set the tindex field) this journal's transactions, counting upward from 1.4 hledger-libTie the knot in all of this journal's transactions, ensuring their postings refer to them. This should be done last, after any other transaction-modifying operations.6 hledger-libqUntie all transaction-posting knots in this journal, so that eg recursiveSize and GHCI's :sprint can work on it.7 hledger-libApply any transaction modifier rules in the journal (adding automated postings to transactions, eg). Or if a modifier rule fails to parse, return the error message. A reference date is provided to help interpret relative dates in transaction modifier queries.8 hledger-libCheck any balance assertions in the journal and return an error message if any of them fail (or if the transaction balancing they require fails).5 hledger-libAccess the current balancing state, and possibly modify the mutable bits, lifting through the Except and Reader layers into the Balancing monad.6 hledger-lib5Get this account's current exclusive running balance.7 hledger-lib^Add this amount to this account's exclusive running balance. Returns the new running balance.8 hledger-libnSet this account's exclusive running balance to this amount. Returns the change in exclusive running balance.9 hledger-libSet this account's exclusive running balance to whatever amount makes its *inclusive* running balance (the sum of exclusive running balances of this account and any subaccounts) be the given amount. Returns the change in exclusive running balance.: hledger-lib;Update (overwrite) this transaction in the balancing state.9 hledger-libInfer any missing amounts (to satisfy balance assignments and to balance transactions) and check that all transactions balance and (optional) all balance assertions pass. Or return an error message (just the first error encountered)._Assumes journalInferCommodityStyles has been called, since those affect transaction balancing.This does multiple things at once because amount inferring, balance assignments, balance assertions and posting dates are interdependent.; hledger-libThis function is called statefully on each of a date-ordered sequence of 1. fully explicit postings from already-balanced transactions and 2. not-yet-balanced transactions containing balance assignments. It executes balance assignments and finishes balancing the transactions, and checks balance assertions on each posting as it goes. An error will be thrown if a transaction can't be balanced or if an illegal balance assignment is found (cf checkIllegalBalanceAssignment). Transaction prices are removed, which helps eg balance-assertions.test: 15. Mix different commodities and assignments. This stores the balanced transactions in case 2 but not in case 1.< hledger-libJIf this posting has an explicit amount, add it to the account's running balance. If it has a missing amount and a balance assignment, infer the amount from, and reset the running balance to, the assigned balance. If it has a missing amount and no balance assignment, leave it for later. Then test the balance assertion if any.= hledger-libVAdd the posting's amount to its account's running balance, and optionally check the posting's balance assertion if any. The posting is expected to have an explicit amount (otherwise this does nothing). Adding and checking balance assertions are tightly paired because we need to see the balance as it stands after each individual posting.> hledger-lib Check a posting's balance assertion against the given actual balance, and return an error if the assertion is not satisfied. If the assertion is partial, unasserted commodities in the actual balance are ignored; if it is total, they will cause the assertion to fail.? hledger-libDoes this (single commodity) expected balance match the amount of that commodity in the given (multicommodity) actual balance ? If not, returns a balance assertion failure message based on the provided posting. To match, the amounts must be exactly equal (display precision is ignored here). If the assertion is inclusive, the expected amount is compared with the account's subaccount-inclusive balance; otherwise, with the subaccount-exclusive balance.@ hledger-libMThrow an error if this posting is trying to do an illegal balance assignment.A hledger-libThrow an error if this posting is trying to do a balance assignment and has a custom posting date (which makes amount inference too hard/impossible).B hledger-libThrow an error if this posting is trying to do a balance assignment and the account does not allow balance assignments (eg because it is referenced by a transaction modifier, which might generate additional postings to it).: hledger-libChoose and apply a consistent display style to the posting amounts in each commodity. Each commodity's style is specified by a commodity (or D) directive, or otherwise inferred from posting amounts. Can return an error message eg if inconsistent number formats are found.; hledger-librGet the canonical amount styles for this journal, whether declared by commodity directives, by the last default commodity (D) directive, or inferred from posting amounts, as a map from symbol to style. Styles declared by directives take precedence (and commodity takes precedence over D). Styles from directives are guaranteed to specify the decimal mark character.C hledger-lib(Collect and save inferred amount styles for each commodity based on the posting amounts in that commodity (excluding price amounts), ie: "the format of the first amount, adjusted to the highest precision of all amounts". Can return an error message eg if inconsistent number formats are found.< hledger-libGiven a list of amounts, in parse order (roughly speaking; see journalStyleInfluencingAmounts), build a map from their commodity names to standard commodity display formats. Can return an error message eg if inconsistent number formats are found.Though, these amounts may have come from multiple files, so we shouldn't assume they use consistent number formats. Currently we don't enforce that even within a single file, and this function never reports an error.= hledger-libGiven a list of amount styles (assumed to be from parsed amounts in a single commodity), in parse order, choose a canonical style. Traditionally it's "the style of the first, with the maximum precision of all".> hledger-libInfer transaction-implied market prices from commodity-exchanging transactions, if any. It's best to call this after transactions have been balanced and posting amounts have appropriate prices attached.D hledger-libMake a market price equivalent to this posting's amount's unit price, if any. If the posting amount is multicommodity, only the first commodity amount is considered.? hledger-libConvert all this journal's amounts to cost using the transaction prices, if any. The journal's commodity styles are applied to the resulting amounts.E hledger-libGet an ordered list of amounts in this journal which can influence canonical amount display styles. Those amounts are, in the following order:7amounts in market price (P) directives (in parse order)0posting amounts in transactions (in parse order)7the amount in the final default commodity (D) directiveKTransaction price amounts (posting amounts' aprice field) are not included.@ hledger-libGet an ordered list of s from the amounts in this journal which influence canonical amount display styles. See traverseJournalAmounts. journalAmounts :: Journal -> [Amount] journalAmounts = getConst . traverseJournalAmounts (Const . (:[]))| Apply a transformation to the journal amounts traversed by traverseJournalAmounts. overJournalAmounts :: (Amount -> Amount) -> Journal -> Journal overJournalAmounts f = runIdentity . traverseJournalAmounts (Identity . f)| A helper that traverses over most amounts in the journal, in particular the ones which influence canonical amount display styles, processing them with the given applicative function.&These include, in the following order:7the amount in the final default commodity (D) directive7amounts in market price (P) directives (in parse order)0posting amounts in transactions (in parse order)Transaction price amounts, which may be embedded in posting amounts (the aprice field), are left intact but not traversed/processed.traverseJournalAmounts :: Applicative f => (Amount -> f Amount) -> Journal -> f Journal traverseJournalAmounts f j = recombine  $> (traverse . dcamt) f (jparsedefaultcommodity j)  *8 (traverse . pdamt) f (jpricedirectives j)  *W (traverse . tps . traverse . pamt . amts . traverse) f (jtxns j) where recombine pds txns = j { jpricedirectives = pds, jtxns = txns } -- a bunch of traversals dcamt g pd = (mdc -> case mdc of Nothing -> Nothing Just ((c,stpd{pdamount =amt} )  $F g (pdamount pd) pdamt g pd = (amt -> pd{pdamount =amt})  $F g (pdamount pd) tps g t = (ps -> t {tpostings=ps })  $F g (tpostings t) pamt g p = (amt -> p {pamount =amt})  $/ g (pamount p) amts g (Mixed as) = Mixed  $ g asThe fully specified date span enclosing the dates (primary or secondary) of all this journal's transactions and postings, or DateSpan Nothing Nothing if there are none.A hledger-lib\The earliest of this journal's transaction and posting dates, or Nothing if there are none.B hledger-libZThe latest of this journal's transaction and posting dates, or Nothing if there are none.C hledger-libApply the pivot transformation to all postings in a journal, replacing their account name by their value for the given field or tag.F hledger-libeReplace this transaction's postings' account names with the value of the given field or tag, if any.G hledger-librReplace this posting's account name with the value of the given field or tag, if any, otherwise the empty string.6 !"#$%&'()*+,-./0123456789:;<=>?@ABCDE69>:<;?34C*+,-/.012 !@AB()&'"$%#=8567DENone J hledger-libDFilter a journal's transactions with the given query, then build a Ledger, containing the journal plus the tree of all its accounts with their subaccount-inclusive and subaccount-exclusive balances. If the query includes a depth limit, the ledger's journal will be depth limited, but the ledger's account tree will not.K hledger-libList a ledger's account names.L hledger-lib$Get the named account from a ledger.M hledger-libGet this ledger's root account, which is a dummy "root" account above all others. This should always be first in the account list, if somehow not this returns a null account.N hledger-libLList a ledger's top-level accounts (the ones below the root), in tree order.O hledger-libGList a ledger's bottom-level (subaccount-less) accounts, in tree order.P hledger-lib.List a ledger's postings, in the order parsed.Q hledger-libThe (fully specified) date span containing all the ledger's (filtered) transactions, or DateSpan Nothing Nothing if there are none.R hledger-lib$All commodities used in this ledger. IJKLMNOPQRS IJKLMNOPQRSNone-eFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~      !"#$%&'(      !"#$%&'()*+,-./0789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`bcdefghijklmnopqrstuvwxyz{|}~    !"#$%&'()*+,-./0123456789:;<=>?@ABCDEIJKLMNOPQRSUUNone479DV hledger-lib4A full name, display name, and depth for an account.[ hledger-libJDescription of one subreport within a compound balance report. Part of a CompoundBalanceCommandSpec, but also used in hledger-lib.a hledger-libA compound balance report has:an overall title%the period (date span) of each columnone or more named, normal-positive multi balance reports, with columns corresponding to the above, and a flag indicating whether they increased or decreased the overall totalsKa list of overall totals for each column, and their grand total and average`It is used in compound balance report commands like balancesheet, cashflow and incomestatement.m hledger-lib2A periodic report is a generic tabular report, where each row corresponds to some label (usually an account name) and each column to a date period. The column periods are usually consecutive subperiods formed by splitting the overall report period by some report interval (daily, weekly, etc.). It has: *a list of each column's period (date span) a list of rows, each containing:an account labelthe account's depthA list of amounts, one for each column. Depending on the value type, these can represent balance changes, ending balances, budget performance, etc. (for example, see  BalanceType and Hledger.Cli.Commands.Balance).the total of the row's amounts for a periodic report, or zero for cumulative/historical reports (since summing end balances generally doesn't make sense). the average of the row's amounts nthe column totals, and the overall grand total (or zero for cumulative/historical reports) and grand average.w hledger-lib3Figure out the overall date span of a PeridicReportx hledger-lib}Given a PeriodicReport and its normal balance sign, if it is known to be normally negative, convert it to normally positive.y hledger-lib"Map a function over the row names.z hledger-lib<Map a function over the row names, possibly discarding some.H hledger-lib;Map a function over the row names of the PeriodicReportRow.I hledger-libAMap maybe a function over the row names of the PeriodicReportRow.{ hledger-libPConstruct a flat display name, where the full name is also displayed at depth 1| hledger-libSConstruct a tree display name, where only the leaf is displayed at its given depth} hledger-libNGet the full, canonical, name of a PeriodicReportRow tagged by a DisplayName.~ hledger-libDGet the display name of a PeriodicReportRow tagged by a DisplayName. hledger-libEGet the display depth of a PeriodicReportRow tagged by a DisplayName.r hledger-libThe average of us or ts in a report or report row.s hledger-lib The sum of u7s in a report or a report row. Does not make sense for ts.t hledger-lib"An ending balance as of some date.u hledger-lib,A change in balance during a certain period.*VWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~*mnopqghijklvutsrwxyzabcdef[\]^_`VWXYZ{|}~ None"#_! hledger-libStandard options for customising report filtering and output. Most of these correspond to standard hledger command-line options or query arguments, but not all. Some are used only by certain commands, as noted below. hledger-libThe current date. A late addition to ReportOpts. Optional, but when set it may affect some reports: Reports use it when picking a -V valuation date. This is not great, adds indeterminacy. hledger-lib(Zero, one, or two statuses to be matched hledger-lib+What value should amounts be converted to ? hledger-lib'Infer market prices from transactions ? hledger-libBAll query arguments space sepeareted and quoted if needed (see  ) hledger-lib)if true, flip all amount signs in reports hledger-libThis can be set when running balance reports on a set of accounts with the same normal balance type (eg all assets, or all incomes). - It helps --sort-amount know how to sort negative numbers (eg in the income section of an income statement) - It helps compound balance report commands (is, bs etc.) do sign normalisation, converting normally negative subreports to normally positive for a more conventional display. hledger-libWhether to use ANSI color codes in text output. Influenced by the --color/colour flag (cf CliOptions), whether stdout is an interactive terminal, and the value of TERM and existence of NO_COLOR environment variables. hledger-libaShould accounts be displayed: in the command's default style, hierarchically, or as a flat list ? hledger-lib3Which "balance" is being shown in a balance report. hledger-lib%The change of balance in each period. hledger-lib/The accumulated change across multiple periods. hledger-libThe historical ending balance, including the effect of all postings before the report period. Unless altered by, a query, this is what you would see on a bank statement.J hledger-libPDo extra validation of raw option values, raising an error if there's a problem. hledger-libMDo extra validation of report options, raising an error if there's a problem. hledger-libJGet the report interval, if any, specified by the last of -p/--period, -D --daily, -Wh--weekly, -M/--monthly etc. options. An interval from --period counts only if it is explicitly defined. hledger-lib,get period expression from --forecast optionK hledger-libvExtract the interval from the parsed -p/--period expression. Return Nothing if an interval is not explicitly defined.L hledger-libBGet any statuses to be matched, as specified by -U/--unmarked, -P --pending, -C`--cleared flags. -UPC is equivalent to no flags, so this returns a list of 0-2 unique statuses. hledger-libmReduce a list of statuses to just one of each status, and if all statuses are present return the empty list. hledger-lib@Add/remove this status from the status list. Used by hledger-ui.M hledger-libEParse the type of valuation to be performed, if any, specified by -B--cost, -V, -XZ--exchange, or --value flags. If there's more than one of these, the rightmost flag wins. hledger-lib6Select the Transaction date accessor based on --date2. hledger-lib2Select the Posting date accessor based on --date2. hledger-lib5Report which date we will report on based on --date2. hledger-lib;Legacy-compatible convenience aliases for accountlistmode_. hledger-libConvert this journal's postings' amounts to cost using their transaction prices, if specified by options (-B/--value=cost). Maybe soon superseded by newer valuation code. hledger-libkConvert report options and arguments to a query. If there is a parsing problem, this function calls error. hledger-libPConvert report options to a query, ignoring any non-flag command line arguments. hledger-libqConvert report options and arguments to query options. If there is a parsing problem, this function calls error. hledger-lib@The effective report span is the start and end dates specified by options or queries, or otherwise the earliest and latest transaction or posting dates in the journal. If no dates are specified by options/queries and the journal is empty, returns the null date span. Needs IO to parse smart dates in options/queries. hledger-libThe specified report start/end dates are the dates specified by options or queries, if any. Needs IO to parse smart dates in options/queries.KK!None"#=?PX; N hledger-libA summary posting summarises the activity in one account within a report interval. It is kludgily represented by a regular Posting with no description, the interval's start date stored as the posting date, and the interval's end date attached with a tuple. hledger-libA postings report is a list of postings with a running total, a label for the total field, and a little extra transaction info to help with rendering. This is used eg for the register command. hledger-libSelect postings from the journal and add running balance and other information to make a postings report. Used by eg hledger's register command.O hledger-lib Based on the given report options, return a function that does the appropriate running calculation for the register report, ie a running average or running total. This function will take the item number, previous average/total, and new posting amount, and return the new average/total.P hledger-libZAdjust report start/end dates to more useful ones based on journal data and report intervals. Ie: 1. If the start date is unspecified, use the earliest date in the journal (if any) 2. If the end date is unspecified, use the latest date in the journal (if any) 3. If a report interval is specified, enlarge the dates to enclose whole intervalsQ hledger-libFind postings matching a given query, within a given date span, and also any similarly-matched postings before that date span. Date restrictions and depth restrictions in the query are ignored. A helper for the postings report.R hledger-libsGenerate postings report line items from a list of postings or (with non-Nothing dates attached) summary postings. hledger-libGenerate one postings report line item, containing the posting, the current running balance, and optionally the posting date and/or the transaction description.S hledger-libConvert a list of postings into summary postings, one per interval, aggregated to the specified depth if any. Each summary posting will have a non-Nothing interval end date.T hledger-libGiven a date span (representing a report interval) and a list of postings within it, aggregate the postings into one summary posting per account. Each summary posting will have a non-Nothing interval end date.When a depth argument is present, postings to accounts of greater depth are also aggregated where possible. If the depth is 0, all postings in the span are aggregated into a single posting with account name "...".TThe showempty flag includes spans with no postings and also postings with 0 amount."None"#=?X@" hledger-libA journal entries report is a list of whole transactions as originally entered in the journal (mostly). This is used by eg hledger's print command and hledger-web's journal entries view. hledger-lib*Select transactions for an entries report.#None"#=?h hledger-lib_An account transactions report represents transactions affecting a particular account (or possibly several accounts, but we don't use that). It is used eg by hledger-ui's and hledger-web's register view, and hledger's aregister report, where we want to show one row per transaction, in the context of the current account. Report items consist of:the transaction, unmodifiedXthe transaction as seen in the context of the current account and query, which means:the transaction date is set to the "transaction context date", which can be different from the transaction's general date: if postings to the current account (and matched by the report query) have their own dates, it's the earliest of these dates.ethe transaction's postings are filtered, excluding any which are not matched by the report query9a text description of the other account(s) posted to/fromFa flag indicating whether there's more than one other account involved2the total increase/decrease to the current accountthe report transactions' running total after this transaction; or if historical balance is requested (-H), the historical running total. The historical running total includes transactions from before the report start date if one is specified, filtered by the report query. The historical running total may or may not be the account's historical running balance, depending on the report query.Items are sorted by transaction register date (the earliest date the transaction posts to the current account), most recent first. Reporting intervals are currently ignored. hledger-libMGenerate transactions report items from a list of transactions, using the provided user-specified report query, a query specifying which account to use as the focus, a starting balance, a sign-setting function and a balance-summing function. Or with a None current account query, this can also be used for the transactionsReport. hledger-libWhat is the transaction's date in the context of a particular account (specified with a query) and report query, as in an account register ? It's normally the transaction's general date, but if any posting(s) matched by the report query and affecting the matched account(s) have their own earlier dates, it's the earliest of these dates. Secondary transaction/posting dates are ignored.U hledger-libGenerate a simplified summary of some postings' accounts. To reduce noise, if there are both real and virtual postings, show only the real ones.$None"#=?vk hledger-libA transactions report includes a list of transactions touching multiple accounts (posting-filtered and unfiltered variants), a running balance, and some other information helpful for rendering a register view (a flag indicating multiple other accounts and a display string describing them) with or without a notion of current account(s). Two kinds of report use this data structure, see transactionsReport and accountTransactionsReport below for details. hledger-libSelect transactions from the whole journal. This is similar to a "postingsReport" except with transaction-based report items which are ordered most recent first. XXX Or an EntriesReport - use that instead ? This is used by hledger-web's journal view. hledger-libSplit a transactions report whose items may involve several commodities, into one or more single-commodity transactions reports.  %None"#$>HPSVWX_ ;4V hledger-lib:Description of a single digit group in a number literal.  Thousands8 is one well known digit grouping, but there are others.W hledger-libThe number of digits in this group. This is Word to avoid the need to do overflow checking for the Semigroup instance of DigitGrp.X hledger-libQThe natural number formed by this group's digits. This should always be positive.Y hledger-libAnother kind of number literal: this one contains either a digit group separator or a decimal mark, we're not sure which (eg 1,000 or 100.50).Z hledger-lib,Some kinds of number literal we might parse.[ hledger-libA number with no digit group marks (eg 100), or with a leading or trailing comma or period which (apparently) we interpret as a decimal mark (like 100. or .100)\ hledger-libSA number with identifiable digit group marks (eg 1,000,000 or 1,000.50 or 1 000) hledger-libVarious options to use when reading journal files. Similar to CliOptions.inputflags, simplifies the journal-reading functions. hledger-lib_a file/storage format to try, unless overridden by a filename prefix. Nothing means try all. hledger-lib1a conversion rules file to use (when reading CSV) hledger-libaccount name aliases to apply hledger-lib.do light anonymisation/obfuscation of the data hledger-libdon't check balance assertions hledger-lib8read only new transactions since this file was last read hledger-lib0save latest new transactions state for next time hledger-lib/use the given field's value as the account name hledger-lib2generate automatic postings when journal is parsed hledger-libA hledger journal reader is a triple of storage format name, a detector of that format, and a parser from that format to Journal. The type variable m appears here so that rParserr can hold a journal parser, which depends on it.  hledger-libBRun a text parser in the identity monad. See also: parseWithState.  hledger-libBRun a text parser in the identity monad. See also: parseWithState.  hledger-lib=Run a journal parser in some monad. See also: parseWithState.  hledger-lib=Run a journal parser in some monad. See also: parseWithState.  hledger-libGRun an erroring journal parser in some monad. See also: parseWithState. hledger-libGRun an erroring journal parser in some monad. See also: parseWithState. hledger-lib^Construct a generic start & end line parse position from start and end megaparsec SourcePos's. hledger-libGiven a parser to ParsedJournal, input options, file path and content: run the parser on the content, and finalise the result to get a Journal; or throw an error. hledger-libLike parseAndFinaliseJournal but takes a (non-Erroring) JournalParser. Used for timeclock/timedot. TODO: get rid of this, use parseAndFinaliseJournal instead hledger-libMPost-process a Journal that has just been parsed or generated, in this order:apply canonical amount styles,Hsave misc info and reverse transactions into their original parse order,:evaluate balance assignments and balance each transaction,7apply transaction modifiers (auto postings) if enabled,$check balance assertions if enabled.?infer transaction-implied market prices from transaction prices hledger-lib2Get amount style associated with default currency.Returns t used to defined by a latest default commodity directive prior to current position within this file or its parents. hledger-lib&Lookup currency-specific amount style.Returns g used in commodity directive within current journal prior to current position or in its parents files.% hledger-libParse a date in YYYY-MM-DD format. Slash (/) and period (.) are also allowed as separators. The year may be omitted if a default year has been set. Leading zeroes may be omitted.& hledger-lib\Parse a date and time in YYYY-MM-DD HH:MM[:SS][+-ZZZZ] format. Slash (/) and period (.) are also allowed as date separators. The year may be omitted if a default year has been set. Seconds are optional. The timezone is optional and ignored (the time is always interpreted as a local time). Leading zeroes may be omitted (except in a timezone).] hledger-libHParse a year number or an Int. Years must contain at least four digits.( hledger-lib5Parse an account name (plus one following space if present), then apply any parent account prefix and/or account aliases currently in effect, in that order. (Ie first add the parent account prefix, then rewrite with aliases). This calls error if any account alias with an invalid regular expression exists.) hledger-lib*Parse an account name, plus one following space if present. Account names have one or more parts separated by the account separator character, and are terminated by two or more spaces (or end of input). Each part is at least one character long, may have single spaces inside it, and starts with a non-whitespace. Note, this means "{account}", "%^!" and ";comment" are all accepted (parent parsers usually prevent/consume the last). It should have required parts to start with an alphanumeric; for now it remains as-is for backwards compatibility.* hledger-libParse any text beginning with a non-whitespace character, until a double space or the end of input. TODO including characters which normally start a comment (;#) - exclude those ? + hledger-lib Similar to *T, except that the text must only contain characters satisfying the given predicate., hledger-libOParse one non-newline whitespace character that is not followed by another one.- hledger-libParse whitespace then an amount, with an optional left or right currency symbol and optional price, or return the special "missing" marker amount.. hledger-libParse a single-commodity amount, with optional symbol on the left or right, followed by, in any order: an optional transaction price, an optional ledger-style lot price, and/or an optional ledger-style lot date. A lot price and lot date will be ignored./ hledger-lib/Parse an amount from a string, or get an error.0 hledger-lib4Parse a mixed amount from a string, or get an error.^ hledger-lib{Parse a minus or plus sign followed by zero or more spaces, or nothing, returning a function that negates or does nothing.5 hledger-libPParse a string representation of a number for its value and display attributes.Some international number formats are accepted, eg either period or comma may be used for the decimal mark, and the other of these may be used for separating digit groups in the integer part. See  .http://en.wikipedia.org/wiki/Decimal_separator for more examples.This returns: the parsed numeric value, the precision (number of digits seen following the decimal mark), the decimal mark character used if any, and the digit group style if any.6 hledger-lib+Interpret a raw number as a decimal number.Returns: - the decimal number - the precision (number of digits after the decimal point) - the decimal point character, if any - the digit group style, if any (digit group character and sizes of digit groups)7 hledger-librParse and interpret the structure of a number without external hints. Numbers are digit strings, possibly separated into digit groups by one of two types of separators. (1) Numbers may optionally have a decimal mark, which may be either a period or comma. (2) Numbers may optionally contain digit group marks, which must all be either a period, a comma, or a space.It is our task to deduce the characters used as decimal mark and digit group mark, based on the allowed syntax. For instance, we make use of the fact that a decimal mark can occur at most once and must be to the right of all digit group marks.#parseTest rawnumberp "1,234,567.89">Right (WithSeparators ',' ["1","234","567"] (Just ('.',"89")))parseTest rawnumberp "1,000"$Left (AmbiguousNumber "1" ',' "000")parseTest rawnumberp "1 000".Right (WithSeparators ' ' ["1","000"] Nothing)9 hledger-libA blank or comment line in journal format: a line that's empty or containing only whitespace or whose first non-whitespace character is semicolon, hash, or star.: hledger-libJParse the text of a (possibly multiline) comment following a journal item.(rtp followingcommentp "" -- no commentRight ""Rrtp followingcommentp ";" -- just a (empty) same-line comment. newline is added Right "\n"rtp followingcommentp "; \n" Right "\n"Grtp followingcommentp ";\n ;\n" -- a same-line and a next-line comment Right "\n\n"rtp followingcommentp "\n ;\n" -- just a next-line comment. Insert an empty same-line comment so the next-line comment doesn't become a same-line comment. Right "\n\n"; hledger-lib1Parse a transaction comment and extract its tags.The first line of a transaction may be followed by comments, which begin with semicolons and extend to the end of the line. Transaction comments may span multiple lines, but comment lines below the transaction must be preceded by leading whitespace.20001s1 ; a transaction comment starting on the same line ... ; extending to the next line account1 $1 account2Tags are name-value pairs.let getTags (_,tags) = tags6let parseTags = fmap getTags . rtp transactioncommentp3parseTags "; name1: val1, name2:all this is value2"7Right [("name1","val1"),("name2","all this is value2")]A tag's name must be immediately followed by a colon, without separating whitespace. The corresponding value consists of all the text following the colon up until the next colon or newline, stripped of leading and trailing whitespace.< hledger-lib7Parse a posting comment and extract its tags and dates.Postings may be followed by comments, which begin with semicolons and extend to the end of the line. Posting comments may span multiple lines, but comment lines below the posting must be preceded by leading whitespace.20001c1 account1 $1 ; a posting comment starting on the same line ... ; extending to the next line:account2 ; a posting comment beginning on the next lineTags are name-value pairs.let getTags (_,tags,_,_) = tags<let parseTags = fmap getTags . rtp (postingcommentp Nothing)3parseTags "; name1: val1, name2:all this is value2"7Right [("name1","val1"),("name2","all this is value2")]A tag's name must be immediately followed by a colon, without separating whitespace. The corresponding value consists of all the text following the colon up until the next colon or newline, stripped of leading and trailing whitespace.Posting dates may be expressed with "date"/"date2" tags or with bracketed date syntax. Posting dates will inherit their year from the transaction date if the year is not specified. We throw parse errors on invalid dates.#let getDates (_,_,d1,d2) = (d1, d2)Blet parseDates = fmap getDates . rtp (postingcommentp (Just 2000))+parseDates "; date: 1/2, date2: 1999/12/31"'Right (Just 2000-01-02,Just 1999-12-31)parseDates "; [1/2=1999/12/31]"'Right (Just 2000-01-02,Just 1999-12-31)cExample: tags, date tags, and bracketed dates >>> rtp (postingcommentp (Just 2000)) "; a:b, date:34, [=56]" Right ("a:b, date:34, [=5@6]n",[("a","b"),("date","3/4")],Just 2000-03-04,Just 2000-05-06)rExample: extraction of dates from date tags ignores trailing text >>> rtp (postingcommentp (Just 2000)) "; date:34=56" Right ("date:34=56n",[("date","34=56")],Just 2000-03-04,Nothing)= hledger-lib#Parse Ledger-style bracketed posting dates ([DATE=DATE2]), as "date" and/or "date2" tags. Anything that looks like an attempt at this (a square-bracketed sequence of 0123456789/-.= containing at least one digit and one date separator) is also parsed, and will throw an appropriate error.The dates are parsed in full here so that errors are reported in the right position. A missing year in DATE can be inferred if a default date is provided. A missing year in DATE2 will be inferred from DATE.aeither (Left . customErrorBundlePretty) Right $ rtp (bracketeddatetagsp Nothing) "[2016/1/2=3/4]"0Right [("date",2016-01-02),("date2",2016-03-04)]Veither (Left . customErrorBundlePretty) Right $ rtp (bracketeddatetagsp Nothing) "[1]"Left ...not a bracketed date...^either (Left . customErrorBundlePretty) Right $ rtp (bracketeddatetagsp Nothing) "[2016/1/32]"9Left ...1:2:...well-formed but invalid date: 2016/1/32...Yeither (Left . customErrorBundlePretty) Right $ rtp (bracketeddatetagsp Nothing) "[1/31]"JLeft ...1:2:...partial date 1/31 found, but the current year is unknown...geither (Left . customErrorBundlePretty) Right $ rtp (bracketeddatetagsp Nothing) "[0123456789/-.=/-.=]")Left ...1:13:...expecting month or day...C hledger-libDA custom show instance, showing digit groups as the parser saw them.K      !"#$%&'()*+,-./0123456789:;<=>K      !"#$%&'()-./0123456789:;<=*+,>&NoneW O_ hledger-libParse and post-process a Journal+ from the timedot format, or give an error.` hledger-libKParse timedot day entries to zero or more time transactions for that day.  20202n1 optional day description fos.haskell .... .. biz.research . inc.client1 .... .... .... .... .... .... a hledger-libhZero or more empty lines or hash/semicolon comment lines or org headlines which do not start a new day.b hledger-lib=Parse a single timedot entry to one (dateless) transaction.  fos.haskell .... .. c hledger-libParse a duration of seconds, minutes, hours, days, weeks, months or years, written as a decimal number followed by s, m, h, d, w, mo or y, assuming h if there is no unit. Returns the duration as hours, assuming 1m = 60s, 1h = 60m, 1d = 24h, 1w = 7d, 1mo = 30d, 1y=365d.  1.5 1.5h 90m d hledger-libEParse a quantity written as a line of dots, each representing 0.25.  .... .. e hledger-libXXX new comment line parser, move to Hledger.Read.Common.emptyorcommentlinep Parse empty lines, all-blank lines, and lines beginning with any of the provided comment-beginning characters.JKJK'NoneW Sf hledger-libParse and post-process a Journaln from timeclock.el's timeclock format, saving the provided file path and the current time, or give an error.g hledger-libParse a timeclock entry.LMLM(None"#$%=>?HVWX` 1h hledger-libA conditional block: a set of CSV record matchers, and a sequence of rules which will be enabled only if one or more of the matchers succeeds.Three types of rule are allowed inside conditional blocks: field assignments, skip, end. (A skip or end rule is stored as if it was a field assignment, and executed in validateCsv. XXX)i hledger-lib?A single test for matching a CSV record, in one way or another.j hledger-lib3match if this regexp matches the overall CSV recordk hledger-lib=match if this regexp matches the referenced CSV field's valuel hledger-lib<A prefix for a matcher test, either & or none (implicit or).m hledger-libBA strptime date parsing pattern, as supported by Data.Time.Format.n hledger-libmA text value to be assigned to a hledger field, possibly containing csv field references to be interpolated.o hledger-libOne of the standard hledger fields or pseudo-fields that can be assigned to. Eg date, account1, amount, amount1-in, date-format.p hledger-libLPercent symbol followed by a CSV field name or column number. Eg: %date, %1.q hledger-lib1-based CSV column number.r hledger-libCSV field name.s hledger-lib8The keyword of a CSV rule - "fields", "skip", "if", etc.t hledger-libType used after parsing is done. Directives, assignments and conditional blocks are in the same order as they were in the unput file and rblocksassigning is functional. Ready to be used for CSV record processingu hledger-libType used by parsers. Directives, assignments and conditional blocks are in the reverse order compared to what is in the file and rblocksassigning is non-functional, could not be used for processing CSV records yetv hledger-libA set of data definitions and account-matching patterns sufficient to convert a particular CSV data file into meaningful journal transactions.w hledger-lib*top-level rules, as (keyword, value) pairsx hledger-libEcsv field names and their column number, if declared by a fields listy hledger-libNtop-level assignments to hledger fields, as (field name, value template) pairsz hledger-libaconditional blocks, which containing additional assignments/rules to apply to matched csv records{ hledger-libVall conditional blocks which can potentially assign field with a given name (memoized)| hledger-libParse and post-process a Journal from CSV data, or give an error. Does not check balance assertions. XXX currently ignores the provided data, reads it from the file path instead.R hledger-libAn pure-exception-throwing IO action that parses this file's content as CSV conversion rules, interpolating any included files first, and runs some extra validation checks.S hledger-libLGiven a CSV file path, what would normally be the corresponding rules file ?T hledger-libPGiven a CSV rules file path, what would normally be the corresponding CSV file ?} hledger-libInline all files referenced by include directives in this hledger CSV rules text, recursively. Included file paths may be relative to the directory of the provided file path. This is done as a pre-parse step to simplify the CSV rules parser.~ hledger-libAn error-throwing IO action that parses this text as CSV conversion rules and runs some extra validation checks. The file path is used in error messages. hledger-libMParse this text as CSV conversion rules. The file path is for error messages. hledger-lib(Return the validated rules, or an error. hledger-lib=Create CsvRules from the content parsed out of the rules file hledger-libuGroup matchers into associative pairs based on prefix, e.g.: A & B C D & E => [[A, B], [C], [D, E]] hledger-libA single matcher for a specific field. A csv field reference (like %date or %1), and a pattern on the rest of the line, optionally space-separated. Eg: %description chez jacques hledger-libxRead a Journal from the given CSV data (and filename, used for error messages), or return an error. Proceed as follows: parse CSV conversion rules from the specified rules file, or from the default rules file for the specified CSV file, if it exists, or throw a parse error; if it doesn't exist, use built-in default rules*parse the CSV data, or throw a parse error7convert the CSV records to transactions using the rulesMif the rules file didn't exist, create it with the default rules and filename$return the transactions as a Journal hledger-libkParse special separator names TAB and SPACE, or return the first character. Return Nothing on empty string hledger-libIReturn the cleaned up and validated CSV data (can be empty), or an error. hledger-lib;Look up the value (template) of a csv rule by rule keyword. hledger-libLook up the value template assigned to a hledger field by field list/field assignment rules, taking into account the current record and conditional rules. hledger-lib]Look up the final value assigned to a hledger field, with csv field references interpolated. hledger-libFigure out the amount specified for posting N, if any. A currency symbol to prepend to the amount, if any, is provided, and whether posting 1 requires balancing or not. This looks for a non-empty amount value assigned to "amountN", "amountN-in", or "amountN-out". For postings 1 or 2 it also looks at "amount", "amount-in", "amount-out". If more than one of these has a value, it looks for one that is non-zero. If there's multiple non-zeros, or no non-zeros but multiple zeros, it throws an error. hledger-libtFigure out the expected balance (assertion or assignment) specified for posting N, if any (and its parse position). hledger-lib)Make a balance assertion for the given amount, with the given parse position (to be shown in assertion failures), with the assertion type possibly set by a balance-type rule. The CSV rules and current record are also provided, to be shown in case balance-type's argument is bad (XXX refactor). hledger-libFigure out the account name specified for posting N, if any. And whether it is the default unknown account (which may be improved later) or an explicitly set account (which may not). hledger-lib)Default account names to use when needed. hledger-libCanonicalise the sign in a CSV amount string. Such strings can have a minus sign, negating parentheses, or any two of these (which cancels out).simplifySign "1""1"simplifySign "-1""-1"simplifySign "(1)""-1"simplifySign "--1""1"simplifySign "-(1)""1"simplifySign "(-1)""1"simplifySign "((1))""1" hledger-lib;Show a (approximate) recreation of the original CSV record. hledger-libGiven the conversion rules, a CSV record and a hledger field name, find the value template ultimately assigned to this field, if any, by a field assignment at top level or in a conditional block matching this record.Note conditional blocks' patterns are matched against an approximation of the CSV record: all the field values, without enclosing quotes, comma-separated. hledger-libRender a field assignment's template, possibly interpolating referenced CSV field values. Outer whitespace is removed from interpolated values. hledger-libReplace something that looks like a reference to a csv field ("%date" or "%1) with that field's value. If it doesn't look like a field reference, or if we can't find such a field, leave it unchanged. hledger-libGet the (whitespace-stripped) value of a CSV field, identified by its name or column number, ("date" or "1"), from the given CSV record, if such a field exists. hledger-libiParse the date string using the specified date-format, or if unspecified the "simple date" formats (YYYYMM6DD, YYYY-MM-DD, YYYY.MM.DD, leading zeroes optional). NOPQRSTUV QPONTSRUV)None "#$>PWX  hledger-lib]A file path optionally prefixed by a reader name and colon (journal:, csv:, timedot:, etc.).` hledger-lib findReader mformat mpathFind the reader named by mformato, if provided. Or, if a file path is provided, find the first reader that handles its file extension, if any.a hledger-libsIf a filepath is prefixed by one of the reader names and a colon, split that off. Eg "csv:-" -> (Just "csv", "-"). hledger-libParse and post-process a Journal7 from hledger's journal file format, or give an error. hledger-lib2Get the account name aliases from options, if any.c hledger-lib,A journal parser. Accumulates and returns a  ParsedJournal2, which should be finalised/validated before use.*rejp (journalp <* eof) "2015/1/1\n a 0\n"6Right (Right Journal with 1 transactions, 1 accounts) hledger-libbA side-effecting parser; parses any kind of journal item and updates the parse state accordingly.d hledger-libHParse any journal directive and update the parse state accordingly. Cf  )http://hledger.org/manual.html#directives, =http://ledger-cli.org/3.0/doc/ledger3.html#Command-Directives hledger-libParse an include directive. include's argument is an optionally file-format-prefixed file path or glob pattern. In the latter case, the prefix is applied to each matched path. Examples: foo.j, foobar.j, timedot:foo2020*.md hledger-libfLift an IO action into the exception monad, rethrowing any IO error with the given message prepended. hledger-lib3Parse a one-line or multi-line commodity directive.4Right _ <- rjp commoditydirectivep "commodity $1.00"@Right _ <- rjp commoditydirectivep "commodity $\n format $1.00"RRight _ <- rjp commoditydirectivep "commodity $\n\n" -- a commodity with no format\Right _ <- rjp commoditydirectivep "commodity $1.00\n format $1.00" -- both, what happens ? hledger-lib%Parse a one-line commodity directive.;Right _ <- rjp commoditydirectiveonelinep "commodity $1.00"DRight _ <- rjp commoditydirectiveonelinep "commodity $1.00 ; blah\n" hledger-libRParse a multi-line commodity directive, containing 0 or more format subdirectives.XRight _ <- rjp commoditydirectivemultilinep "commodity $ ; blah \n format $1.00 ; blah" hledger-libbParse a format (sub)directive, throwing a parse error if its symbol does not match the one given. hledger-libWBacktracking parser similar to string, but allows varying amount of space between words hledger-lib2Parse a transaction modifier (auto postings) rule. hledger-lib"Parse a periodic transaction rule.This reuses periodexprp which parses period expressions on the command line. This is awkward because periodexprp supports relative and partial dates, which we don't really need here, and it doesn't support the notion of a default year set by a Y directive, which we do need to consider here. We resolve it as follows: in periodic transactions' period expressions, if there is a default year Y in effect, partial/relative dates are calculated relative to Y191. If not, they are calculated related to today as usual. hledger-lib*Parse a (possibly unbalanced) transaction.  "%&(9:`abcdefghi`ab  cdfg&%(h"9:ei*NoneWX 8 j hledger-lib]A file path optionally prefixed by a reader name and colon (journal:, csv:, timedot:, etc.).k hledger-libPRead a Journal from the given text, assuming journal format; or throw an error.l hledger-lib readJournal iopts mfile txt:Read a Journal from some text, or return an error message.;The reader (data format) is chosen based on, in this order:a reader name provided in ioptsa reader prefix in the mfile patha file extension in mfileIf none of these is available, or if the reader name is unrecognised, we use the journal reader. (We used to try all readers in this case; since hledger 1.17, we prefer predictability.)m hledger-libNRead the default journal file specified by the environment, or raise an error.n hledger-lib#Get the default journal file path specified by the environment. Like ledger, we look first for the LEDGER_FILE environment variable, and if that does not exist, for the legacy LEDGER environment variable. If neither is set, or the value is blank, return the hard-coded default, which is .hledger.journalh in the users's home directory (or in the current directory, if we cannot determine a home directory).o hledger-liblRead a Journal from each specified file path and combine them into one. Or, return the first error message.6Combining Journals means concatenating them, basically. The parse state resets at the start of each file, which means that directives & aliases do not affect subsequent sibling or parent files. They do affect included child files though. Also the final parse state saved in the Journal does span all files.p hledger-libRead a Journal from this file, or from stdin if the file path is -, or return an error message. The file path can have a READER: prefix.MThe reader (data format) to use is determined from (in priority order): the mformat_ specified in the input options, if any; the file path's READER: prefix, if any; a recognised file name extension. if none of these identify a known reader, the journal reader is used.The input options can also configure balance assertion checking, automated posting generation, a rules file for converting CSV data, etc.q hledger-lib^If the specified journal file does not exist (and is not "-"), give a helpful error and quit.r hledger-libEnsure there is a journal file at the given path, creating an empty one if needed. On Windows, also ensure that the path contains no trailing dots which could cause data loss (see ). hledger-lib}Does any part of this path contain non-. characters and end with a . ? Such paths are not safe to use on Windows (cf #1056). hledger-lib5Give the content for a new auto-created journal file. hledger-libGet all instances of the latest date in an unsorted list of dates. Ie, if the latest date appears once, return it in a one-element list, if it appears three times (anywhere), return three of it. hledger-lib[Remember that these transaction dates were the latest seen when reading this journal file. hledger-lib&What were the latest transaction dates seen the last time this journal file was read ? If there were multiple transactions on the latest date, that number of dates is returned, otherwise just one. Or none if no transactions were read, or if latest dates info is not available for this file. hledger-libOWhere to save latest transaction dates for the given file path. (.latest.FILE) hledger-libGiven zero or more latest dates (all the same, representing the latest previously seen transaction date, and how many transactions were seen on that date), remove transactions with earlier dates from the journal, and the same number of transactions on the latest date, if any, leaving only transactions that we can assume are newer. Also returns the new latest dates of the new journal.Y      !"#$%&'()*+,-./0123456789:;<=>`aehjklmnopqrsjmnopqrlkeh`as+None >N| hledger-libHfor simplicity, we assume that each cell is rendered on a single line hledger-lib'We stop rendering on the shortest list!| hledger-lib pretty tables hledger-libpretty hledger-libmax width for each column hledger-libpretty hledger-libwidth specificationstwuvx{zy|}~|}~x{zytwuv,None"#=?X  hledger-libA multi balance report is a kind of periodic report, where the amounts correspond to balance changes or ending balances in a given period. It has: *a list of each column's period (date span) a list of rows, each containing:6the full account name, display name, and display depth'A list of amounts, one for each column.4the total of the row's amounts for a periodic report the average of the row's amounts nthe column totals, and the overall grand total (or zero for cumulative/historical reports) and grand average. hledger-libGenerate a multicolumn balance report for the matched accounts, showing the change of balance, accumulated balance, or historical balance in each of the specified periods. If the normalbalance_ option is set, it adjusts the sorting and sign of amounts (see ReportOpts and CompoundBalanceCommand). hledger's most powerful and useful report, used by the balance command (in multiperiod mode) and (via compoundBalanceReport) by the bscf is commands. hledger-lib`A helper for multiBalanceReport. This one takes an explicit Query instead of deriving one from ReportOpts, and an extra argument, a PriceOracle to be used for looking up market prices. Commands which run multiple reports (bs etc.) can generate the price oracle just once for efficiency, passing it to each report by calling this function directly. hledger-libqGenerate a compound balance report from a list of CBCSubreportSpec. This shares postings between the subreports. hledger-libFA helper for compoundBalanceReport, similar to multiBalanceReportWith. hledger-lib-Calculate starting balances, if needed for -HNBalances at report start date, from all earlier postings which otherwise match the query. These balances are unvalued. TODO: Do we want to check whether to bother calculating these? isHistorical and startDate is not nothing, otherwise mempty? This currently gives a failure with some totals which are supposed to be 0 being blank. hledger-lib1Calculate the span of the report to be generated. hledger-libRemove any date queries and insert queries from the report span. The user's query expanded to the report span if there is one (otherwise any date queries are left as-is, which handles the hledger-ui+future txns case above). hledger-lib'Group postings, grouped by their column hledger-lib<Gather postings matching the query within the report period. hledger-libACalculate the DateSpans to be used for the columns of the report. hledger-libbGather the account balance changes into a regular matrix including the accounts from all columns. hledger-libGiven a set of postings, eg for a single report column, gather the accounts that have postings and calculate the change amount for each. Accounts and amounts will be depth-clipped appropriately if a depth limit is in effect. hledger-libAAccumulate and value amounts, as specified by the report options.,Makes sure all report columns have an entry. hledger-libLay out a set of postings grouped by date span into a regular matrix with rows given by AccountName and columns by DateSpan, then generate a MultiBalanceReport from the columns. hledger-libBuild the report rows.TOne row per account, with account name info, row amounts, row total and row average. hledger-lib\Calculate accounts which are to be displayed in the report, as well as their name and depth hledger-lib8Sort the rows by amount or by account declaration order. hledger-libBuild the report totals row.HCalculate the column totals. These are always the sum of column amounts. hledger-lib7Map the report rows to percentages and negate if needed hledger-lib1Transpose a Map of HashMaps to a HashMap of Maps.6Makes sure that all DateSpans are present in all rows. hledger-libA sorting helper: sort a list of things (eg report rows) keyed by account name to match the provided ordering of those same account names. hledger-librGiven a list of account names, find all forking parent accounts, i.e. those which fork between different branches hledger-libA helper: what percentage is the second mixed amount of the first ? Keeps the sign of the first amount. Uses unifyMixedAmount to unify each argument and then divides them. Both amounts should be in the same, single commodity. This can call error if the arguments are not right.  -None"#$X  hledger-libMA budget report tracks expected and actual changes per account and subperiod. hledger-libCalculate budget goals from all periodic transactions, actual balance changes from the regular transactions, and compare these to get a C. Unbudgeted accounts may be hidden or renamed (see budgetRollup). hledger-libUse all periodic transactions in the journal to generate budget transactions in the specified report period. Budget transactions are similar to forecast transactions except their purpose is to set goal amounts (of change) per account and period. hledger-libCAdjust a journal's account names for budget reporting, in two ways: oaccounts with no budget goal anywhere in their ancestry are moved under the "unbudgeted" top level account.subaccounts with no budget goal are merged with their closest parent account with a budget goal, so that only budgeted accounts are shown. This can be disabled by --empty. hledger-lib|Combine a per-account-and-subperiod report of budget goals, and one of actual change amounts, into a budget performance report. The two reports should have the same report interval, but need not have exactly the same account rows or date columns. (Cells in the combined budget report can be missing a budget goal, an actual amount, or both.) The combined report will include:fconsecutive subperiods at the same interval as the two reports, spanning the period of both reportslall accounts mentioned in either report, sorted by account code or account name or amount as appropriate. hledger-libARender a budget report as plain text suitable for console output. hledger-libBuild a $ from a multi-column balance report. hledger-libMake a name for the given period in a multiperiod report, given the type of balance being reported and the full set of report periods. This will be used as a column heading (or row heading, in a register summary report). We try to pick a useful name as follows:-ending-balance reports: the period's end date{balance change reports where the periods are months and all in the same year: the short month name in the current localeall other balance change reports: a description of the datespan, abbreviated to compact form if possible (see showDateSpan).  .None"#=?X  hledger-lib A simple balance report. It has: 2a list of items, one per account, each containing:the full account namethe Ledger-style elided short account name (the leaf account name, prefixed by any boring parents immediately above); or with --flat, the full account name againthe number of indentation steps for rendering a Ledger-style account tree, taking into account elided boring parents, --no-elide and --flat an amount the total of all amounts hledger-libWhen true (the default), this makes balance --flat reports and their implementation clearer. Single/multi-col balance reports currently aren't all correct if this is false. hledger-lib Enabling this makes balance --flat --empty also show parent accounts without postings, in addition to those with postings and a zero balance. Disabling it shows only the latter. No longer supported, but leave this here for a bit. flatShowsPostinglessAccounts = TrueGenerate a simple balance report, containing the matched accounts and their balances (change of balance) during the specified period. If the normalbalance_ option is set, it adjusts the sorting and sign of amounts (see ReportOpts and CompoundBalanceCommand)./None"#=? VWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~0None  "! #$'&%()*+,0123456789:;<=>FGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~      !"#$%&'(      !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~      !"#$%&'()*+,-./0789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`bcdefghijklmnopqrstuvwxyz{|}~    !"#$%&'()*+,-./0123456789:;<=>?@ABCDEIJKLMNOPQRSUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~      !"#$%&'()*+,-./0123456789:;<=>`aehjklmnopqrs78978:78;78<78=78>78?78@78A78B78C78DEFGEFHEFIEFJEFKEFLEMNEMOEMPQRSQRTQRUQRVQRWQXYQZ[Q\]Q\^Q\_Q\`Q\aQ\bQ\cQ\dQefQegQehQehijklmnopqrstuvwxyz{|}~      !"#$%&'()*+,-./0123456789:;<=>?@ABCCDEFGHIA@BJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~     2               ! " # $ % & ' ( ) * + , - . / 0 1 2 3 4 5 6 7 8 9 : ; < = > ? @ A B C D E F G H I J K L M N O P Q R S T U V W X Y Z [ \ ] ^ _ ` a b c d e f g h i j k l m n o p q r s t u v w x y z {|}~                                                              !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~      !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~                                                                            !!!!!""" " # # # ###$$$$$$$$$$$%%%%%% %!%"%#%$%%%&%&%'%(%)%*%+%,%-%.%/%0%1%2%3%4%5%6%7%8%9%:%;%<%=%>%?%@%A%B%C%D%E%F%G%H%I%J%K%L%M%N%O%P%Q%R%S%T%U%V%W%X%Y%Z%[%\%]%^%_%`%a%b%c%d%e%f%g%h%i%j%k%l%m&n&o'n'p(q(r(s(n(t(u(v(w(x(y(z({(|(}(~((()))n)))))))**********++++++++++++++++++++,,,,,,,,,,,-----------...../0111111112222222222222222E2222  EEEEEEEEEEEEEE                       E !"#$%&'()*+,-./0123456789:;<=>?@ABCEFDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz { | } ~!!!!!!!#%%%%%%%%%&&&&&&&]''(((((((((((((((((((((((((((((((((((((((((((((())))))))))))))*******,,,,,,,,,,,,,,,,,---&hledger-lib-1.19-9fh02T1n4zjASByyfEEecHledger.Utils.ColorHledger.Utils.UTF8IOCompatHledger.Utils.TestHledger.Utils.TreeHledger.Utils.RegexHledger.Data.TypesHledger.Data.PeriodHledger.Data.JsonHledger.Utils.ParseHledger.Utils.StringHledger.Utils.DebugHledger.Utils.Text Hledger.UtilsHledger.Data.RawOptionsHledger.Data.CommodityHledger.Data.AmountHledger.Data.ValuationHledger.Data.AccountNameHledger.Data.StringFormatHledger.Data.DatesHledger.Data.PostingHledger.Data.Transaction Hledger.Query Hledger.Data.TransactionModifierHledger.Data.TimeclockHledger.Data.Account Hledger.Data.PeriodicTransactionHledger.Data.JournalHledger.Data.Ledger Hledger.DataHledger.Reports.ReportTypesHledger.Reports.ReportOptionsHledger.Reports.PostingsReportHledger.Reports.EntriesReport)Hledger.Reports.AccountTransactionsReport"Hledger.Reports.TransactionsReportHledger.Read.CommonHledger.Read.TimedotReaderHledger.Read.TimeclockReaderHledger.Read.CsvReaderHledger.Read.JournalReader Hledger.ReadText.Tabular.AsciiWide"Hledger.Reports.MultiBalanceReportHledger.Reports.BudgetReportHledger.Reports.BalanceReportHledger.ReportsHledgerPaths_hledger_libText.Megaparsec.CustomHledger.Cli.CliOptionsCliOptsYYYY.MMDD)ansi-terminal-0.11-4wmjZYgNWif1HCz52wiJecSystem.Console.ANSI.TypesWhiteCyanMagentaBlueYellowGreenRedBlackColorVividDullColorIntensitybase System.IO appendFile writeFilereadFile getContentsputStrLnputStrGHC.IO.Handle.Text hPutStrLnhPutStr hGetContents"tasty-1.3.1-ATGMwQTMPdI5M7DbQKSS8B Test.Tasty withResource askOption localOption adjustOptiondefaultIngredientsTest.Tasty.CmdLinedefaultMainWithIngredients'Test.Tasty.Ingredients.IncludingOptionsincludingOptionsTest.Tasty.Coreafterafter_ testGroupTestName AllFinish AllSucceedDependencyTypeTestTreeTest.Tasty.Options.Core mkTimeout NoTimeoutTimeoutcolorbgColorFastTreeT treeFromPaths$fShowFastTree $fEqFastTree $fOrdFastTreeerror' userError' usageError RegexError ReplacementRegexpreStringtoRegex toRegexCItoRegex' toRegexCI' regexMatch regexReplaceregexReplaceUnmemoregexReplaceAllBy$fRegexContextRegexp[][]$fRegexLikeRegexp[]$fToJSONRegexp $fReadRegexp $fShowRegexp $fOrdRegexp $fEqRegexpLedgerljournal laccounts NormalSignNormallyPositiveNormallyNegativeAccountanameadeclarationinfoasubsaparentaboring anumpostings aebalance aibalanceAccountDeclarationInfo adicommentaditagsadideclarationorder StorageFormat ParsedJournalJournaljparsedefaultyearjparsedefaultcommodityjparseparentaccounts jparsealiasesjparsetimeclockentriesjincludefilestackjdeclaredaccountsjdeclaredaccounttypes jcommoditiesjinferredcommoditiesjpricedirectivesjinferredmarketprices jtxnmodifiers jperiodictxnsjtxnsjfinalcommentlinesjfiles jlastreadtime MarketPricempdatempfrommptompratePriceDirectivepddate pdcommoditypdamountTimeclockEntry tlsourcepostlcode tldatetime tlaccount tldescription TimeclockCode SetBalanceSetRequiredHoursInOutFinalOutPeriodicTransaction ptperiodexpr ptintervalptspanptstatusptcode ptdescription ptcommentpttags ptpostings TMPostingRuleTransactionModifier tmquerytxttmpostingrules Transactiontindextprecedingcomment tsourcepostdatetdate2tstatustcode tdescriptiontcommentttags tpostingsGenericSourcePosJournalSourcePosPostingpdatepdate2pstatuspaccountpamountpcommentptypeptagspbalanceassertion ptransaction poriginalBalanceAssertionbaamountbatotal bainclusive bapositionStatusUnmarkedPendingClearedDateTagTagTagValueTagName PostingTypeRegularPostingVirtualPostingBalancedVirtualPosting MixedAmountMixedAmount acommodity aquantity aismultiplierastyleaprice CommoditycsymbolcformatCommoditySymbolDigitGroupStyle DigitGroupsAmountPrecision PrecisionNaturalPrecision AmountStyleascommoditysideascommodityspaced asprecisionasdecimalpoint asdigitgroups AmountPrice UnitPrice TotalPriceQuantitySideLR AccountAlias BasicAlias RegexAlias AccountTypeAsset LiabilityEquityRevenueExpenseCash AccountNameInterval NoIntervalDaysWeeksMonthsQuartersYears DayOfMonthWeekdayOfMonth DayOfWeek DayOfYearPeriod DayPeriod WeekPeriod MonthPeriod QuarterPeriod YearPeriod PeriodBetween PeriodFromPeriodTo PeriodAllWeekDayMonthDayYearDay MonthWeekYearWeekQuarterMonthYearDateSpan WhichDate PrimaryDate SecondaryDate SmartIntervalDayWeek SmartSequenceLastThisNext SmartDateSmartAssumeStartSmartFromReference SmartMonth SmartRelativenulltransactionmodifiernullperiodictransactionnullaccountdeclarationinfo$fDefaultDateSpan$fDefaultPeriod$fDefaultInterval$fToMarkupDecimalRaw$fShowAmountStyle $fShowStatus $fShowPosting $fEqPosting$fShowSmartSequence$fShowSmartInterval $fEqWhichDate$fShowWhichDate $fEqDateSpan $fOrdDateSpan$fGenericDateSpan$fShowSmartDate $fEqPeriod $fOrdPeriod $fShowPeriod$fGenericPeriod $fEqInterval$fShowInterval $fOrdInterval$fGenericInterval$fShowAccountType$fEqAccountType$fOrdAccountType$fGenericAccountType$fEqAccountAlias$fReadAccountAlias$fShowAccountAlias$fOrdAccountAlias$fGenericAccountAlias$fEqSide $fShowSide $fReadSide $fOrdSide $fGenericSide$fEqAmountPrecision$fOrdAmountPrecision$fReadAmountPrecision$fShowAmountPrecision$fGenericAmountPrecision$fEqDigitGroupStyle$fOrdDigitGroupStyle$fReadDigitGroupStyle$fShowDigitGroupStyle$fGenericDigitGroupStyle$fEqAmountStyle$fOrdAmountStyle$fReadAmountStyle$fGenericAmountStyle$fShowCommodity $fEqCommodity$fGenericCommodity $fEqAmount $fOrdAmount$fGenericAmount $fShowAmount$fEqAmountPrice$fOrdAmountPrice$fGenericAmountPrice$fShowAmountPrice$fEqMixedAmount$fOrdMixedAmount$fGenericMixedAmount$fShowMixedAmount$fEqPostingType$fShowPostingType$fGenericPostingType $fEqStatus $fOrdStatus$fBoundedStatus $fEnumStatus$fGenericStatus$fEqGenericSourcePos$fReadGenericSourcePos$fShowGenericSourcePos$fOrdGenericSourcePos$fGenericGenericSourcePos$fEqBalanceAssertion$fGenericBalanceAssertion$fShowBalanceAssertion$fEqTransaction$fGenericTransaction$fShowTransaction$fGenericPosting$fEqTransactionModifier$fGenericTransactionModifier$fShowTransactionModifier$fEqPeriodicTransaction$fGenericPeriodicTransaction$fEqTimeclockCode$fOrdTimeclockCode$fGenericTimeclockCode$fEqTimeclockEntry$fOrdTimeclockEntry$fGenericTimeclockEntry$fEqPriceDirective$fOrdPriceDirective$fGenericPriceDirective$fShowPriceDirective$fEqMarketPrice$fOrdMarketPrice$fGenericMarketPrice$fEqAccountDeclarationInfo$fShowAccountDeclarationInfo$fGenericAccountDeclarationInfo $fEqJournal$fGenericJournal$fGenericAccount$fShowNormalSign$fEqNormalSign$fGenericClockTimeperiodAsDateSpandateSpanAsPeriodsimplifyPeriodisLastDayOfMonthisStandardPeriod showPeriodshowPeriodMonthAbbrev periodStart periodEnd periodNextperiodPrevious periodNextInperiodPreviousIn periodMoveTo periodGrow periodShrink mondayBeforeyearMonthContainingWeekStartingquarterContainingMonthfirstMonthOfQuarterstartOfFirstWeekInMonth toJsonText writeJsonFile readJsonFile$fFromJSONDecimalRaw$fFromJSONAccount $fFromJSONAccountDeclarationInfo$fFromJSONTransaction$fFromJSONPosting$fFromJSONPostingType$fFromJSONMarketPrice$fFromJSONAmountPrice$fFromJSONBalanceAssertion$fFromJSONMixedAmount$fFromJSONDigitGroupStyle$fFromJSONSide$fFromJSONAmountPrecision$fFromJSONAmountStyle$fFromJSONAmount$fFromJSONGenericSourcePos$fFromJSONStatus$fToJSONLedger$fToJSONAccount$fToJSONJournal$fToJSONClockTime$fToJSONTimeclockEntry$fToJSONTimeclockCode$fToJSONCommodity$fToJSONAccountDeclarationInfo$fToJSONKeyAccountType$fToJSONAccountType$fToJSONAccountAlias$fToJSONInterval$fToJSONDateSpan$fToJSONPriceDirective$fToJSONPeriodicTransaction$fToJSONTransactionModifier$fToJSONTransaction$fToJSONPosting$fToJSONPostingType$fToJSONMarketPrice$fToJSONAmountPrice$fToJSONBalanceAssertion$fToJSONMixedAmount$fToJSONDigitGroupStyle $fToJSONSide$fToJSONAmountPrecision$fToJSONAmountStyle$fToJSONAmount$fToJSONDecimalRaw$fToJSONGenericSourcePos$fToJSONStatus$fGenericDecimalRaw$fGenericLedger CustomErrErroringJournalParser JournalParser TextParserSimpleTextParserSimpleStringParserchoice' choiceInState surroundedBy parsewithparsewithStringparseWithStateparseWithState' fromparse parseerrorshowDateParseErrornonspaceisNonNewlineSpacespacenonewline restoflineskipNonNewlineSpacesskipNonNewlineSpaces1skipNonNewlineSpaces'eoloftakeEnd lowercase uppercasestriplstriprstripchomp singleline stripbrackets elideLeft elideRight formatString underline quoteIfNeededsingleQuoteIfNeededwords'unwords' unbracketconcatTopPaddedconcatBottomPadded concatOneLinevConcatLeftAlignedvConcatRightAlignedpadtop padbottompadleftpadright cliptopleftfitto fitStringfitStringMulti padLeftWide padRightWide takeWidthstrWidth stripAnsi charWidthpprintpshowptrace traceWith debugLeveltraceAt traceAtWithptraceAt ptraceAtWithdbg0dbg1dbg2dbg3dbg4dbg5dbg6dbg7dbg8dbg9dbg0Withdbg1Withdbg2Withdbg3Withdbg4Withdbg5Withdbg6Withdbg7Withdbg8Withdbg9WithdbgExit ptraceAtIOdbg0IOdbg1IOdbg2IOdbg3IOdbg4IOdbg5IOdbg6IOdbg7IOdbg8IOdbg9IOplogplogAt traceParsedbgparseteststest assertLeft assertRight assertParse assertParseEqassertParseEqOnassertParseErrorassertParseStateOn assertParseEassertParseEqEassertParseErrorEtextElideRight quoteIfSpacedtextQuoteIfNeededescapeDoubleQuotes stripquotes textUnbrackettextConcatTopPaddedfitTexttextPadLeftWidetextPadRightWide textTakeWidth textWidth readDecimal tests_Textfirst3second3third3first4second4third4fourth4first5second5third5fourth5fifth5first6second6third6fourth6fifth6sixth6curry2uncurry2curry3uncurry3curry4uncurry4splitAtElementgetCurrentLocalTimegetCurrentZonedTimeapplyN expandPathexpandHomePathreadFilePortablyreadFileOrStdinPortablyreadHandlePortablymaximum' sumStrict maximumStrict minimumStrict sequence'mapM'embedFileRelative tests_Utils $fDefaultBoolRawOptssetopt setboolopt inRawOptsboolopt choiceopt collectoptsmaybestringopt stringopt maybecharoptlistofstringopt maybeintoptmaybeposintoptintopt posintopt$fDefaultRawOpts $fShowRawOptsisNonsimpleCommodityCharquoteCommoditySymbolIfNeeded commoditycommoditysymbolscommconversionRate amountstyleamountnullamt missingamtnumhrsusdeurgbpperat@@amountWithCommodity amountCostamountTotalPriceToUnitPrice divideAmountmultiplyAmountdivideAmountAndPricemultiplyAmountAndPriceisNegativeAmountamountLooksZero amountIsZero withPrecisionsetAmountPrecisionsetFullPrecisionshowAmountDebugshowAmountWithoutPricesetAmountInternalPrecisionwithInternalPrecisionsetAmountDecimalPointwithDecimalPoint styleAmountstyleAmountExceptPrecision showAmount cshowAmountshowAmountWithZeroCommoditycanonicaliseAmount nullmixedamtmissingmixedamtmixednormaliseMixedAmount*normaliseMixedAmountSquashPricesForDisplayunifyMixedAmountamountsfilterMixedAmountfilterMixedAmountByCommoditymapMixedAmountmixedAmountCostdivideMixedAmountmultiplyMixedAmountdivideMixedAmountAndPricemultiplyMixedAmountAndPriceaverageMixedAmountsisNegativeMixedAmountmixedAmountLooksZeromixedAmountIsZerostyleMixedAmountshowMixedAmount showMixedAmountWithZeroCommodityshowMixedAmountOneLine ltraceamountsetMixedAmountPrecisionshowMixedAmountWithPrecisionshowMixedAmountDebugshowMixedAmountWithoutPricemixedAmountStripPrices"showMixedAmountOneLineWithoutPriceshowMixedAmountElidedcanonicaliseMixedAmount mixedAmountTotalPriceToUnitPrice tests_Amount$fNumMixedAmount $fNumAmount$fShowMarketPrice PriceOracle ValuationTypeAtCostAtThenAtEndAtNowAtDate AtDefaultjournalPriceOraclepriceDirectiveToMarketPricemixedAmountApplyValuationunsupportedValueThenErrormixedAmountValueAtDatemarketPriceReversetests_Valuation$fShowValuationType$fEqValuationType$fShowPriceGraph$fGenericPriceGraph acctsepcharacctsepaccountNameComponentsaccountNameFromComponentsaccountLeafNameaccountSummarisedNameaccountNameLevelunbudgetedAccountNameaccountNameDropexpandAccountNamesexpandAccountNametopAccountNamesparentAccountNameparentAccountNamesisAccountNamePrefixOfisSubAccountNameOfsubAccountNamesFromaccountNameTreeFromelideAccountNameclipAccountNameclipOrEllipsifyAccountName escapeNameaccountNameToAccountRegexaccountNameToAccountOnlyRegextests_AccountNameReportItemField AccountFieldDefaultDateFieldDescriptionField TotalFieldDepthSpacerFieldFieldNoStringFormatComponent FormatLiteral FormatField StringFormatOneLine TopAligned BottomAlignedparseStringFormatdefaultStringFormatStyletests_StringFormat$fShowReportItemField$fEqReportItemField$fShowStringFormatComponent$fEqStringFormatComponent$fShowStringFormat$fEqStringFormatshowDate showDateSpanshowDateSpanMonthAbbrev getCurrentDaygetCurrentMonthgetCurrentYearelapsedSeconds spanStartspanEnd spanStartYear spanEndYear spanYears spansSpan splitSpan daysInSpanspanContainsDateperiodContainsDatespansIntersect spanIntersectspanDefaultsFrom spansUnion spanUniondaysSpanlatestSpanContainingparsePeriodExprparsePeriodExpr' maybePeriodfixSmartDateStrfixSmartDateStrEitherfixSmartDateStrEither' fixSmartDateprevday parsedateM smartdate datesepchars datesepchar isDateSepCharyearp periodexprp nulldatespan emptydatespannulldate$fShowDateSpan nullpostingpostingpostvpostpost'vpost' nullsourcepos nullassertion balassert balassertTotbalassertParIncbalassertTotIncoriginalPosting showPosting showCommentisReal isVirtualisBalancedVirtual hasAmounthasBalanceAssignmentaccountNamesFromPostings sumPostings removePrices postingDate postingDate2 postingStatuspostingAllTagstransactionAllTagsrelatedPostingsisPostingInDateSpanisPostingInDateSpan'isEmptyPostingaccountNamePostingTypeaccountNameWithoutPostingTypeaccountNameWithPostingTypejoinAccountNamesconcatAccountNamesaccountNameApplyAliasesaccountNameApplyAliasesMemopostingApplyValuation postingToCostpostingTransformAmount commentJoin commentAddTagcommentAddTagNextLine tests_PostingsourceFilePathsourceFirstLineshowGenericSourcePosnulltransaction transactiontransactionPayeetransactionNoteshowTransactionshowTransactionUnelidedshowTransactionOneLineAmounts%showTransactionUnelidedOneLineAmountsshowPostingLinesshowAccountNamehasRealPostings realPostingsassignmentPostingsvirtualPostingsbalancedVirtualPostingstransactionsPostingsisTransactionBalancedbalanceTransactionbalanceTransactionHelperannotateErrorWithTransactiontransactionDate2 txnTieKnot txnUntieKnottransactionTransformPostingstransactionApplyValuationtransactionToCosttests_TransactionQueryOptQueryOptInAcctOnlyQueryOptInAcctQueryAnyNoneNotOrAndCodeDescAcctDateDate2StatusQRealAmtSymEmptyDepthpayeeTagnoteTaggeneratedTransactionTag parseQuerywords''prefixes simplifyQuery filterQuery queryIsNull queryIsDepth queryIsDate queryIsDate2queryIsDateOrDate2 queryIsAcct queryIsAmt queryIsSym queryIsReal queryIsStatus queryIsEmptyqueryIsStartDateOnlyqueryStartDate queryEndDate queryDateSpanqueryDateSpan' queryDepth inAccountinAccountQuerymatchesAccountmatchesMixedAmountmatchesCommodity matchesAmountmatchesPostingmatchesTransaction matchesTagsmatchesPriceDirective tests_Query $fShowOrdPlus $fEqOrdPlus $fEqQuery $fShowQuery$fShowQueryOpt $fEqQueryOptmodifyTransactionstimeclockEntriesToTransactionstests_Timeclock$fReadTimeclockCode$fShowTimeclockCode$fShowTimeclockEntrynullacctaccountsFromPostings accountTreetieAccountParentsparentAccountsaccountsLevels mapAccounts anyAccounts sumAccounts clipAccountsclipAccountsAndAggregate pruneAccountsflattenAccountsfilterAccountssortAccountTreeByAmountaccountSetDeclarationInfosortAccountNamesByDeclarationsortAccountTreeByDeclarationaccountDeclarationOrderAndName lookupAccount printAccounts showAccountsshowAccountsBoringFlagshowAccountDebug $fEqAccount $fShowAccountrunPeriodicTransaction!checkPeriodicTransactionStartDate$fShowPeriodicTransaction nulljournaljournalFilePathjournalFilePathsaddTransactionaddTransactionModifieraddPeriodicTransactionaddPriceDirectivejournalTransactionAtjournalNextTransactionjournalPrevTransactionjournalDescriptionsjournalPostingsjournalAccountNamesUsedjournalAccountNamesImpliedjournalAccountNamesDeclared!journalAccountNamesDeclaredOrUsed$journalAccountNamesDeclaredOrImpliedjournalAccountNamesjournalAssetAccountQueryjournalCashAccountQueryjournalLiabilityAccountQueryjournalEquityAccountQueryjournalRevenueAccountQueryjournalExpenseAccountQueryjournalBalanceSheetAccountQuery journalProfitAndLossAccountQueryfilterJournalTransactionsfilterJournalPostingsfilterJournalAmountsfilterTransactionAmountsfilterPostingAmountfilterTransactionPostingsmapJournalTransactionsmapJournalPostingsmapTransactionPostingsjournalReversejournalSetLastReadTimejournalNumberAndTieTransactionsjournalUntieTransactionsjournalModifyTransactionsjournalCheckBalanceAssertionsjournalBalanceTransactionsjournalApplyCommodityStylesjournalCommodityStylescommodityStylesFromAmountscanonicalStyleFrom(journalInferMarketPricesFromTransactions journalToCostjournalDateSpanjournalStartDatejournalEndDate journalPivot samplejournal tests_Journal$fDefaultJournal$fSemigroupJournal $fShowJournal nullledgerledgerFromJournalledgerAccountNames ledgerAccountledgerRootAccountledgerTopAccountsledgerLeafAccountsledgerPostingsledgerDateSpanledgerCommodities tests_Ledger $fShowLedger tests_Data DisplayName displayFull displayName displayDepthCBCSubreportSpeccbcsubreporttitlecbcsubreportquerycbcsubreportnormalsigncbcsubreportincreasestotalCompoundPeriodicReportcbrTitlecbrDates cbrSubreports cbrTotalsPeriodicReportRowprrName prrAmountsprrTotal prrAveragePeriodicReportprDatesprRowsprTotalsAverageTotalBalanceChange PercentageperiodicReportSpanprNormaliseSign prMapNameprMapMaybeNameflatDisplayNametreeDisplayName prrFullNameprrDisplayNameprrDepth$fSemigroupPeriodicReportRow$fToJSONDisplayName$fShowPeriodicReportRow$fFunctorPeriodicReportRow$fGenericPeriodicReportRow$fToJSONPeriodicReportRow$fShowPeriodicReport$fFunctorPeriodicReport$fGenericPeriodicReport$fToJSONPeriodicReport$fShowCompoundPeriodicReport$fGenericCompoundPeriodicReport$fToJSONCompoundPeriodicReport$fShowDisplayName$fEqDisplayName$fOrdDisplayName ReportOptstoday_period_ interval_ statuses_value_ infer_value_depth_date2_empty_ no_elide_real_format_query_average_related_ txn_dates_ balancetype_accountlistmode_drop_ row_total_ no_total_pretty_tables_ sort_amount_percent_invert_normalbalance_color_ forecast_ transpose_AccountListModeALFlatALTree BalanceType PeriodChangeCumulativeChangeHistoricalBalance FormatStr defreportoptsrawOptsToReportOptscheckReportOptsintervalFromRawOptsforecastPeriodFromRawOptssimplifyStatusesreportOptsToggleStatusvaluationTypeIsCostvaluationTypeIsDefaultValuetransactionDateFn postingDateFnwhichDateFromOptstree_flat_journalSelectingAmountFromOpts queryFromOptsqueryFromOptsOnlyqueryOptsFromOpts reportSpanreportStartDate reportEndDatespecifiedStartEndDatesspecifiedStartDatespecifiedEndDatereportPeriodStartreportPeriodOrJournalStartreportPeriodLastDayreportPeriodOrJournalLastDaytests_ReportOptions$fDefaultBalanceType$fDefaultAccountListMode$fDefaultReportOpts$fEqBalanceType$fShowBalanceType$fEqAccountListMode$fShowAccountListMode$fShowReportOptsPostingsReportItemPostingsReportpostingsReportmkpostingsReportItemtests_PostingsReportEntriesReportItem EntriesReport entriesReporttests_EntriesReportAccountTransactionsReportItemAccountTransactionsReportaccountTransactionsReportaccountTransactionsReportItemstransactionRegisterDatetests_AccountTransactionsReportTransactionsReportItemTransactionsReporttriOrigTransactiontriDate triAmount triBalancetriCommodityAmounttriCommodityBalancetransactionsReporttransactionsReportByCommoditytests_TransactionsReport InputOptsmformat_ mrules_file_aliases_anon_ignore_assertions_new_ new_save_pivot_auto_ReaderrFormat rExtensionsrReadFnrParser definputoptsrawOptsToInputOpts runTextParserrtprunJournalParserrjprunErroringJournalParserrejpgenericSourcePosjournalSourcePosparseAndFinaliseJournalparseAndFinaliseJournal'journalFinalisesetYeargetYearsetDefaultCommodityAndStylegetDefaultCommodityAndStylegetDefaultAmountStylegetAmountStyleaddDeclaredAccountTypepushParentAccountpopParentAccountgetParentAccountaddAccountAliasgetAccountAliasesclearAccountAliasesjournalAddFilestatuspcodep descriptionpdatep datetimepsecondarydatepmodifiedaccountnamep accountnamepsinglespacedtextpsinglespacedtextsatisfyingp singlespacepspaceandamountormissingpamountpamountp' mamountp'commoditysymbolp priceamountpbalanceassertionp lotpricepnumberp fromRawNumber rawnumberpmultilinecommentpemptyorcommentlinepfollowingcommentptransactioncommentppostingcommentpbracketeddatetagsp tests_Common$fDefaultInputOpts $fShowReader$fMonoidDigitGrp$fSemigroupDigitGrp$fShowDigitGrp$fShowInputOpts $fEqDigitGrp$fShowAmbiguousNumber$fEqAmbiguousNumber$fShowRawNumber $fEqRawNumberreader timedotfileptimeclockfilepCsvValue CsvRecordCSVparseRulesFile rulesFileFor csvFileForprintCSVtests_CsvReader$fShowErrorComponent[]$fShowCsvRules' $fEqCsvRules'$fShowMatcherPrefix$fEqMatcherPrefix $fShowMatcher $fEqMatcher$fShowConditionalBlock$fEqConditionalBlock findReadersplitReaderPrefixjournalp directivep accountaliaspdefaultyeardirectivepmarketpricedirectiveppostingptests_JournalReaderPrefixedFilePath readJournal' readJournaldefaultJournaldefaultJournalPathreadJournalFilesreadJournalFilerequireJournalFileExistsensureJournalFileExists tests_ReadHPosHLHMHRVPosVTVMVBrender verticalBarleftBarrightBarmidBar doubleMidBar renderColumns renderHLine renderHLine'boxcharpicklineartCompoundBalanceReportMultiBalanceReportRowMultiBalanceReportmultiBalanceReportmultiBalanceReportWithcompoundBalanceReportcompoundBalanceReportWithsortRows sortRowsLike tableAsTexttests_MultiBalanceReport BudgetReportBudgetReportRow BudgetCell BudgetAverage BudgetTotal BudgetGoal budgetReportbudgetReportAsTextbudgetReportAsTablereportPeriodNametests_BudgetReportBalanceReportItem BalanceReportflatShowsExclusiveBalance balanceReporttests_BalanceReport tests_Reports tests_Hledger mkRegexErr*regex-base-0.94.0.0-541xQVwwNRiBGjsNKmOPoyText.Regex.Base.RegexLike matchTestversion getBinDir getLibDir getDynLibDir getDataDir getLibexecDir getSysconfDirgetDataFileNameFinalParseErrorBundle''megaparsec-8.0.0-KrrDMW2Buch4hz7NuE8od7Text.Megaparsec.Error ParseErrorParseErrorBundleFinalParseError'transformers-0.5.5.0Control.Monad.Trans.ExceptExceptTFinalParseErrorBundleFinalParseError SourceExcerpt text-1.2.3.1Data.Text.InternalText ErrorFailAtErrorReparsing parseErrorAtparseErrorAtRegiongetExcerptTextexcerpt_reparseExcerptcustomErrorBundlePrettyerrorBundlePrettyText.Megaparsec.StatePosStateText.Megaparsec runParserT finalErrorfinalFancyFailure fancyFailure finalFailControl.Monad.Fail MonadFailfinalCustomFailure customFailurefinalErrorBundlePretty attachSourceparseIncludeFile traceParseAt Debug.Tracetrace traceMarkerIO traceMarker traceEventIO traceEvent traceStack traceShowMtraceM traceShowId traceShowtraceId putTraceMsgtraceIOGHC.Stack.Types HasCallStack+tasty-hunit-0.10.0.2-6CD6S3yWQkqKAPjhrokYWdTest.Tasty.HUnit testCaseInfotestCaseTest.Tasty.HUnit.Steps testCaseStepsTest.Tasty.HUnit.Orig assertString@?@?=@=? assertEqual assertBool assertFailure AssertionAssertionPredicableassertionPredicate HUnitFailure AssertableassertAssertionPredicatemaybeclippedintopt GHC.MaybeJustsimilarAmountsOpamountRoundedQuantityshowAmountWithPrecisionshowamountquantitypunctuatenumber sumSimilarAmountsUsingFirstPrice PriceGraphprGraph prNodemapprDefaultValuationCommoditiesamountApplyValuationamountValueAtDate priceLookupmakePriceGrapheffectiveMarketPricesnodepathEdgeLabels pathEdgesnodesEdgeLabel isEmptySpanspanFromSmartDatenthdayofyearcontainingnthdayofmonthcontainingnthdayofweekcontainingnthweekdayofmonthcontainingadvancetonthweekday smartdateonlydoubledatespanpquarterdatespanppostingValueAtDatepayeeAndNoteFromDescriptionshowTransactionHelperrenderCommentLinespostingsAsLinesprintpostingAsLinesshowBalanceAssertion lineIndent commentSpacetransactionCheckBalancedtransactionBalanceErrorinferBalancingAmountinferBalancingPricespriceInferrerForpostingSetTransactionOrdPlusparseQueryTermparseAmountQueryTerm parseStatus parseBoolearliestMaybeDatelatestMaybeDateearliestMaybeDate'latestMaybeDate' compareAmounttransactionModifierToFunctiontmPostingRuleToFunctionentryFromTimeclockInOutBalancingStatebsStylesbsUnassignablebsAssrt bsBalancesbsTransactions BalancingjournalAccountTypeQueryjournalNumberTransactionsjournalTieTransactionswithRunningBalancegetRunningBalanceBaddToRunningBalanceBsetRunningBalanceBsetInclusiveRunningBalanceBupdateTransactionB%balanceTransactionAndCheckAssertionsB#addOrAssignAmountAndCheckAssertionBaddAmountAndCheckAssertionBcheckBalanceAssertionB"checkBalanceAssertionOneCommodityBcheckIllegalBalanceAssignmentB"checkBalanceAssignmentPostingDateB*checkBalanceAssignmentUnassignableAccountBjournalInferCommodityStylespostingInferredmarketPricejournalStyleInfluencingAmountstransactionPivot postingPivot prrMapNameprrMapMaybeName checkRawOptsextractIntervalOrNothingstatusesFromRawOptsvaluationTypeFromRawOptsSummaryPostingregisterRunningCalculationFnadjustReportDatesmatchedPostingsBeforeAndDuringpostingsReportItemssummarisePostingsByIntervalsummarisePostingsInDateSpansummarisePostingAccountsDigitGrpdigitGroupLengthdigitGroupNumberAmbiguousNumber RawNumber NoSeparatorsWithSeparators yearorintpsignpparsedayp commentlinespentrypnumericquantityp dotquantityptimeclockentrypConditionalBlockMatcher RecordMatcher FieldMatcher MatcherPrefix DateFormat FieldTemplateHledgerFieldNameCsvFieldReference CsvFieldIndex CsvFieldName DirectiveNameCsvRulesCsvRulesParsed CsvRules' rdirectivesrcsvfieldindexes rassignmentsrconditionalblocksrblocksassigningexpandIncludesparseAndValidateCsvRules parseCsvRules validateRulesmkrulesgroupedMatchers fieldmatcherpreadJournalFromCsvparseSeparator validateCsvcsvRule hledgerFieldhledgerFieldValue getAmount getBalancemkBalanceAssertion getAccountunknownExpenseAccount simplifySign showRecordgetEffectiveAssignmentrenderTemplatereplaceCsvFieldReference csvFieldValue#parseDateWithCustomOrDefaultFormatsaliasesFromOptsaddJournalItemPincludedirectiveporRethrowIOErrorcommoditydirectivepcommoditydirectiveonelinepcommoditydirectivemultilinepformatdirectivep keywordsptransactionmodifierpperiodictransactionp transactionpisWindowsUnsafeDotPathnewJournalContent latestDatessaveLatestDatespreviousLatestDateslatestDatesFileForjournalFilterSinceLatestDatesstartingBalancescalculateReportSpanmakeReportQuerygetPostingsByColumn getPostingscalculateColSpanscalculateAccountChangesacctChangesFromPostingsaccumValueAmountsgenerateMultiBalanceReportbuildReportRowsdisplayedAccountscalculateTotalsRowpostprocessReport transposeMapsubaccountTallies perdivide budgetJournal budgetRollUpcombineBudgetAndActual&tabular-0.2.2.8-CxCAZY3Z4n73GapwIfIYgw Text.TabularTable