Commit Graph

9820 Commits

Author SHA1 Message Date
Simon Michael
031219e792 ;doc: clarify report intervals' effect on begin/end dates (#1561) 2021-05-18 10:50:52 -10:00
Simon Michael
0727736bff ;update CLI usage texts 2021-05-18 10:35:55 -10:00
Simon Michael
0b15d5771a ;update manuals 2021-05-18 10:35:43 -10:00
Simon Michael
701768765a ;doc: report intervals: expand this doc (#1561) 2021-05-18 10:34:40 -10:00
Stephen Morgan
efaa199a82 doc: Mention expansion of report start and end dates in report intervals. 2021-05-18 10:02:10 -10:00
Stephen Morgan
6c2ab5c940 lib: When matching an account query against a posting, don't try to
match against the same posting twice, in cases when poriginal is
Nothing.
2021-05-16 12:43:13 -10:00
Simon Michael
7abf8eedd5 ;tools: Shake cabalfiles: fix with stack 1.7 (now does a full build) 2021-05-14 16:19:28 -10:00
Simon Michael
d3b20675d0 tools: really regenerate the cabal files with stack's hpack
hpack has dropped the hash at last, this should help a lot to reduce
edit conflicts and commit noise.
2021-05-14 16:14:06 -10:00
Simon Michael
17b241eb64 ui: don't write debug.log when toggling V (#1556) 2021-05-14 11:38:14 -10:00
Simon Michael
239558dd75 ;doc: cli: quick links 2021-05-14 08:46:15 -10:00
Simon Michael
762080058e ;doc: cli: simplify shortcut links: the [] is not needed, hopefully 2021-05-14 08:39:33 -10:00
Simon Michael
c90d89e4fb ;doc: cli: simplify internal links 2021-05-14 08:38:57 -10:00
Simon Michael
d6c12d5379 ;doc: cli: organise common markdown links 2021-05-14 08:34:54 -10:00
Simon Michael
7acfb63e9b ;doc: check: cleanup 2021-05-14 08:30:56 -10:00
Simon Michael
41c8e1f6ef ;regen cabal files with latest stack's hpack (0.34.4) 2021-05-14 08:17:56 -10:00
Simon Michael
1e44371e81 ;doc: cli: more regular expressions linkage 2021-05-14 07:37:13 -10:00
Simon Michael
07128cbb05 ;doc: check: ordereddates: clarify within in each file 2021-05-14 07:36:35 -10:00
Stephen Morgan
940b2c6ab9 lib: Create mixedAmountApplyValuationAfterSumFromOptsWith for doing any valuation needed after summing amounts. 2021-05-13 22:18:52 +10:00
Stephen Morgan
6fb3dfdbb2 lib: Create journalApplyValuationFromOpts.
This does costing and valuation on a journal, and is meant to replace
most direct calls of costing and valuation. The exception is for reports
which require amounts to be summed before valuation is applied, for
example a historical balance report with --value=end.
2021-05-13 19:52:32 +10:00
Stephen Morgan
dc16451de0 lib: Remove unused (amount|mixedAmount|posting|transaction)ApplyCostValuation functions. 2021-05-07 22:25:19 +10:00
Stephen Morgan
53611be6e9 lib,ui: Do all cost conversion and price stripping in journalSelectingAmountFromOpts. 2021-05-07 21:51:15 +10:00
Simon Michael
b6044aa6c8 ;doc: contributing: cleanups, layout fixes for mdbook/commonmark/GFM
CONTRIBUTING now looks better on hledger.org.

mdBook uses the pulldown_cmark lib which implements CommonMark
plus Github Flavoured Markdown extensions such as tables, footnotes,
strikethrough and something else.
2021-05-06 16:02:16 -10:00
Simon Michael
a722ab4338 ;doc: strict mode: fix check link 2021-05-06 14:51:25 -10:00
Simon Michael
b70eaa47c1 ;doc: contributing: add a TOC when viewed on the web 2021-05-06 14:35:44 -10:00
Simon Michael
4b3358f6df ;doc: strict mode: link to check command 2021-05-06 14:31:46 -10:00
charukiewicz
00ffd3ec13 web: fix a bug with keypress listener on the final amount input in AddForm not getting initialized correctly 2021-05-03 07:17:09 -10:00
Stephen Morgan
d1467d4766 lib: When inferring total prices, use the precision of toamount, rather than NaturalPrecision. 2021-05-02 21:14:36 +10:00
Stephen Morgan
686a0871a9 lib: Make sure fromamount and toamount have opposite signs when inferring prices.
Also change priceInferrerFor so that it would give the correct
(negative) prices when fromamount and toamount have the same sign.
2021-05-02 21:14:36 +10:00
Stephen Morgan
0078f1a520 lib: Infer prices correctly even when there are only balance assignments. 2021-05-01 09:45:29 -10:00
Stephen Morgan
7cb621b82f lib,cli,ui,bin: Remove unnecessary normalisedMixedAmount, replace
normaliseMixedAmountSquashPricesForDisplay with mixedAmountStripPrices.
2021-05-01 09:45:29 -10:00
Stephen Morgan
4780a02e5a lib,cli: Remove showAmounts*B functions, replacing them entirely with showMixedAmount*B functions. 2021-05-01 09:45:29 -10:00
Stephen Morgan
5e7b69356f lib: Change internal representation of MixedAmount to use a strict Map
instead of a list of Amounts. No longer export Mixed constructor, to
keep API clean (if you really need it, you can import it directly from
Hledger.Data.Types). We also ensure the JSON representation of
MixedAmount doesn't change: it is stored as a normalised list of
Amounts.

This commit improves performance. Here are some indicative results.

hledger reg -f examples/10000x1000x10.journal
- Maximum residency decreases from 65MB to 60MB (8% decrease)
- Total memory in use decreases from 178MiB to 157MiB (12% decrease)

hledger reg -f examples/10000x10000x10.journal
- Maximum residency decreases from 69MB to 60MB (13% decrease)
- Total memory in use decreases from 198MiB to 153MiB (23% decrease)

hledger bal -f examples/10000x1000x10.journal
- Total heap usage decreases from 6.4GB to 6.0GB (6% decrease)
- Total memory in use decreases from 178MiB to 153MiB (14% decrease)

hledger bal -f examples/10000x10000x10.journal
- Total heap usage decreases from 7.3GB to 6.9GB (5% decrease)
- Total memory in use decreases from 196MiB to 185MiB (5% decrease)

hledger bal -M -f examples/10000x1000x10.journal
- Total heap usage decreases from 16.8GB to 10.6GB (47% decrease)
- Total time decreases from 14.3s to 12.0s (16% decrease)

hledger bal -M -f examples/10000x10000x10.journal
- Total heap usage decreases from 108GB to 48GB (56% decrease)
- Total time decreases from 62s to 41s (33% decrease)

If you never directly use the constructor Mixed or pattern match against
it then you don't need to make any changes. If you do, then do the
following:

- If you really care about the individual Amounts and never normalise
  your MixedAmount (for example, just storing `Mixed amts` and then
  extracting `amts` as a pattern match, then use should switch to using
  [Amount]. This should just involve removing the `Mixed` constructor.
- If you ever call `mixed`, `normaliseMixedAmount`, or do any sort of
  amount arithmetic (+), (-), then you should replace the constructor
  `Mixed` with the function `mixed`. To extract the list of Amounts, use
  the function `amounts`.
- If you ever call `normaliseMixedAmountSquashPricesForDisplay`, you can
  replace that with `mixedAmountStripPrices`. (N.B. this does something
  slightly different from `normaliseMixedAmountSquashPricesForDisplay`,
  but I don't think there's any use case for squashing prices and then
  keeping the first of the squashed prices around. If you disagree let
  me know.)
- Any remaining calls to `normaliseMixedAmount` can be removed, as that
  is now the identity function.
2021-05-01 09:45:29 -10:00
Simon Michael
4013a81af8 Add 'doc/haskellerz/' from commit '79beb34b900b5d35b065e145d6200d227de16945'
git-subtree-dir: doc/haskellerz
git-subtree-mainline: 684af10643
git-subtree-split: 79beb34b90
2021-04-30 13:03:44 -10:00
Simon Michael
79beb34b90 render 2021-04-30 12:53:36 -10:00
Simon Michael
28f0e43aa5 post-talk tweaks 2021-04-30 12:53:29 -10:00
Simon Michael
12cc69b3cf HaskellerZ 2021-04-29 meetup slides 2021-04-30 12:32:50 -10:00
Felix Yan
684af10643 Allow yesod-form 1.7
Builds fine and all tests pass here.
2021-04-23 10:15:27 -10:00
Simon Michael
32b42a6c80 ;journal: another test for #1532 2021-04-21 08:09:36 -10:00
Simon Michael
bf7255402c ;journal: add, renumber commodity parse tests (#1532) 2021-04-20 10:37:31 -10:00
Simon Michael
f58fcd95ab ;journal: tests demonstrating commodity parse errors (#1532) 2021-04-20 09:55:11 -10:00
Simon Michael
a8c6a915e4 examples: csv: kraken 2021-04-19 17:22:04 -10:00
Simon Michael
8cf193547e ;bal: doc: balance features: fix --valuechange link 2021-04-19 16:17:36 -10:00
Simon Michael
39623934c3 ;doc: cli: a note about redirecting debug output 2021-04-17 20:18:05 -10:00
Simon Michael
483fa9682e cli: ANSI color is now also disabled by -o/--output-file (#1533)
ANSI color on stdout (not stderr) is now disabled if the
-o/--output-file option is detected (and its value is not "-").

Added outputFileOption, and more advice in comments.
2021-04-17 16:51:08 -10:00
Simon Michael
fe846a0c7f ;lib: comments 2021-04-17 16:06:20 -10:00
Simon Michael
1afb84c95d lib: outputFileFromOpts now returns a maybe; cleanups 2021-04-17 14:51:24 -10:00
Simon Michael
4b5ad69eb1 ;doc: declaring commodities: better link 2021-04-16 12:19:57 -10:00
Simon Michael
ea812f8f34 ;doc: commodity display style: correction 2021-04-16 12:15:52 -10:00
Simon Michael
659aeef56f ;doc: commodity display style: correction 2021-04-16 12:13:28 -10:00
Simon Michael
949c3925e5 ;doc: add Commodity section, update Amounts & Declaring Commodities (#1532) 2021-04-16 12:00:00 -10:00