hledger/hledger-lib
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
..
Hledger fix:PeriodData: use Integer keys to avoid date wraparound bugs [#2479] 2025-10-11 11:27:58 -10:00
test ;cln: unittest.hs: remove bothersome PackageImports (#2337) 2025-02-26 11:54:59 -10:00
Text dev: switch all qualifed imports to ImportQualifiedPost style 2025-09-29 19:28:59 -10:00
.date.m4 ;doc: update embedded manuals 2025-09-03 20:22:46 +01:00
.ghci tools: .ghci for each package, sets shorter prompt 2016-04-15 16:06:45 -07:00
.version ;pkg: set version to 1.50.99 2025-09-03 20:22:40 +01:00
.version.m4 ;pkg: set version to 1.50.99 2025-09-03 20:22:40 +01:00
CHANGES.md dev: switch all qualifed imports to ImportQualifiedPost style 2025-09-29 19:28:59 -10:00
hledger-lib.cabal dev!: balance: Use DayPartition for multibalance reports. 2025-10-09 15:31:28 -10:00
Hledger.hs ;pkg: tweak LICENSE files, try to get github to recognise 2025-03-31 18:18:10 -10:00
LICENSE ;pkg: simplify LICENSE (try to fix github license detection) 2025-03-31 19:12:38 -10:00
package.yaml pkg: package.yaml files cleanup, consistency 2025-09-29 19:08:50 -10:00
README.md ;doc: more tweaks to package readmes, hackage descriptions 2020-03-22 10:49:02 -07:00
Setup.hs Revert "remove Setup.hs files again, fixing a yesod devel warning" 2014-05-24 13:39:09 -07:00

hledger-lib

A reusable library containing hledgers core functionality. This is used by most hledger* packages so that they support the same common file formats, command line options, reports etc.

See also: the project README and home page.