Commit Graph

3884 Commits

Author SHA1 Message Date
Simon Michael
8a5be241b0 ;doc: update embedded manuals 2025-11-03 06:35:05 -10:00
Simon Michael
71b4a1a281 ;doc:changelogs 2025-10-13 11:35:15 -10:00
Simon Michael
7e885134b3 ;doc: update embedded manuals 2025-10-13 11:28:41 -10:00
Simon Michael
13d1642e5c ;doc:changelogs 2025-10-11 15:03:26 -10:00
Simon Michael
bd0a45d448 fix:PeriodData: simplify, use Day keys [#2479]
This is clearer and slightly better-performing than using Integer.
2025-10-11 11:27:58 -10:00
Simon Michael
438c4a0469 fix:PeriodData: use Integer keys to avoid date wraparound bugs [#2479]
PeriodData's use of Int keys caused wrong results with periodic
reports involving dates outside the machine-specific limits of Int.
Those were:

64 bits: -25252734927764696-04-22..25252734927768413-06-12
32 bits: -5877752-05-08..5881469-05-27
16 bits:  1769-02-28..1948-08-04
 8 bits:  1858-07-12..1859-03-24

32 bits is supported by MicroHS; 16 and 8 bits aren't supported by
any known haskell version, but that could change in future.

For example, on 64 bit machines we got:

25252734927768413-06-12 PeriodData's max date
   (expenses)   1

25252734927768414-01-01 next year past PeriodData's max date
   (expenses)   2

$ hledger reg -O csv --yearly
"txnidx","date","code","description","account","amount","total"
"0","-25252734927764696-11-10","","","expenses","1","1"

Now it uses Integer (like the time package), fixing the bug.
And benchmarking shows memory and time usage slightly improved
(surprisingly; tested with up to 500 subperiods, eg
hledger -f examples/10ktxns-1kaccts.journal reg -1 cur:A -D >/dev/null)
2025-10-11 11:27:58 -10:00
Simon Michael
70e9e7b060 ;dev: lookupDayPartition -> dayPartitionFind 2025-10-11 11:02:18 -10:00
Simon Michael
2e78a53931 ;dev: dayPartitionSpans -> dayPartitionStartEnd 2025-10-11 11:02:18 -10:00
Simon Michael
8779f2481a ;dev: PeriodData, DayPartition: haddock updates
Clarify some things. Also note an example of PeriodData wrapping around.
2025-10-11 11:02:18 -10:00
Stephen Morgan
4e9fa1615c dev!: lib: Refactor splitSpan to return Maybe DayPartition.
This eliminates all error calls from the chain calculating report
periods.
2025-10-09 15:31:28 -10:00
Stephen Morgan
b9caa4d948 dev!: balance: Use DayPartition for multibalance reports.
This allows us to guarantee that the report periods are well-formed and
don't contain errors (e.g. empty spans, spans not contiguous, spans not
a partition).

Note the underlying representation is now for disjoint spans, whereas
previously the end date of a span was equal to the start date of the
next span, and then was adjusted backwards one day when needed.
2025-10-09 15:31:28 -10:00
Caleb Maclennan
3c731ae2f7 fix: Only escape special characters by single quoting, not escaping *and* quoting 2025-10-09 11:52:37 -10:00
Simon Michael
e8672b3a18 fix:Hledger.Utils.String: quoteForCommandLine now quotes "&" [#2468]
This explains the mysterious "7".
2025-10-01 18:15:02 -10:00
Simon Michael
71b1293f06 fix:Hledger.Utils.String: quoteForCommandLine no longer quotes "7" [#2468]
7 is no longer considered a scary shell character.

(This appears to have been harmless, used only for formatting the
balance assertion failure message.)
2025-10-01 17:56:49 -10:00
Simon Michael
215ef5e12d fix:check accounts: don't garble non-ascii account names in errors [#2469]
This regressed in 1.27 or so.
2025-10-01 14:40:08 -10:00
Simon Michael
061d105fed dev:Hledger.Data.Journal: fix a recent ghc 9.6 / old base breakage 2025-09-29 19:31:49 -10:00
Simon Michael
2f007c93d2 dev: switch all qualifed imports to ImportQualifiedPost style 2025-09-29 19:28:59 -10:00
Simon Michael
e10f51e3ae ;cabal: update cabal files 2025-09-29 19:12:00 -10:00
Simon Michael
525f3e76e3 pkg: package.yaml files cleanup, consistency 2025-09-29 19:08:50 -10:00
Simon Michael
e51e6c4e3d ;dev: remove old prototype 2025-09-29 18:35:20 -10:00
Simon Michael
64832c65e8 ;dev: build everything with at least GHC2021 language extensions by default
Previously everything was built with hpack's default, which is Haskell2010.
2025-09-29 18:27:19 -10:00
Simon Michael
81f228cf7f ;doc:changelogs, relnotes:1.50.2 2025-09-26 15:27:15 -10:00
Simon Michael
2b86b806d9 ;doc:changelogs 2025-09-26 15:05:09 -10:00
Simon Michael
a2af816611 dev:Hledger.Utils.IO: inputToHandle -> textToHandle; set utf8 not utf8_bom 2025-09-26 01:08:48 -10:00
Simon Michael
5db4ee7420 dev:Hledger.Utils.IO: readHandlePortably, readHandlePortably' -> hGetContentsPortably 2025-09-26 01:08:43 -10:00
Simon Michael
9351c70f74 fix:csv: respect encoding rule when rules file is input file [#2465] 2025-09-26 00:34:01 -10:00
Simon Michael
8542d8beba imp:errors: improve decode failure wording [#2465] 2025-09-25 01:28:32 -10:00
Simon Michael
e414446076 imp: pivoting on the type tag normalises type values to their short spelling. 2025-09-25 01:11:03 -10:00
Simon Michael
b5f954abf5 imp:errors: decode failures now also mention a possible CSV encoding [#2465] 2025-09-24 10:40:30 -10:00
Simon Michael
19620ba61b ;pkg:lib: make hashtables bounds consistent in cabal file 2025-09-21 11:44:06 -07:00
hseg
240757b259
Avoid hashtables 1.3.x for best gcc compatibility [#2463]
* Forbid solving for hashtables 1.3

On modern gccs, this sometimes causes build failures, see
https://github.com/gregorycollins/hashtables/issues/97

* Propagate constraint to package.yaml too

* stack98: include valid hashtables version

* stack92: add valid hashtables version

* stack94: add valid hashtables version

* stack96: add valid hashtables version
2025-09-21 11:41:57 -07:00
Simon Michael
603185b600 ;doc:changelogs:clarify; show API changes in hledger & hledger-lib separately 2025-09-16 10:11:30 -07:00
Simon Michael
36a1cbaff6 ;doc: changelogs 2025-09-16 05:20:48 -07:00
Simon Michael
fe0d4fd3ec ;doc: changelogs 2025-09-16 04:24:00 -07:00
Stephen Morgan
f515c5f811 fix: balance: Don't display zero rows with --no-elide (#2454)
Zero rows with --no-elide should only be displayed if either --empty is
called or they have non-zero children at some depth.
2025-09-15 15:40:32 -07:00
Simon Michael
8c4e2e08b6 ;cabal: update cabal files 2025-09-13 06:57:22 +01:00
Simon Michael
1d0ea95b9c ;doc:changelogs 2025-09-11 11:09:12 +01:00
Simon Michael
6d164b48a0 imp:journal: in amounts, also allow and ignore empty {} (or {{}}) 2025-09-11 07:33:22 +01:00
Stephen Morgan
aad61e465d fix: balance: Correctly handle empty journals (#2452)
Eliminate several partial functions.
2025-09-11 07:29:27 +01:00
Simon Michael
82552b4ea8 ;doc: update embedded manuals 2025-09-03 20:22:46 +01:00
Simon Michael
8be3e85676 ;cabal: update cabal files 2025-09-03 20:22:40 +01:00
Simon Michael
7ee721eab0 ;pkg: set version to 1.50.99 2025-09-03 20:22:40 +01:00
Simon Michael
dc84d54ae1 ;cabal: update cabal files 2025-09-03 20:07:41 +01:00
Simon Michael
541e0ebf48 ;doc: finalise changelogs for 1.50 on 2025-09-03 2025-09-03 20:03:21 +01:00
Simon Michael
38116dce19 ;doc: update changelogs 2025-09-03 20:03:15 +01:00
Simon Michael
80e659b51c ;pkg: bump minimum supported GHC from 8.10.7 to 9.6 (and base 4.18)
System.IO.hGetContents' was the latest paper cut; I could keep
supporting ghc 8.10.7, or at least 9.0-9.4, released 2021-2023;
but feck it. Debian Stable has 9.6 and this time can be better spent.
2025-09-03 20:02:59 +01:00
Simon Michael
bc55e1c58f dev: fix liftA2, Foldable1 build errors with ghc <9.6 [#2395] 2025-09-03 20:02:12 +01:00
Simon Michael
4f03d22501 ;pkg: update tested-with 2025-09-03 20:00:16 +01:00
Simon Michael
00fae3ac3b fix: ensure liftA2 is imported, build with ghc <9.6
This broke in 1.43.1.
2025-09-02 08:00:08 +01:00
Simon Michael
91d785aee8 dev:fix: use compatible code rather than new T.show added yesterday 2025-09-01 20:08:17 +01:00