Balance.Internal: new module for internal functions - #2745
Conversation
|
|
There was a problem hiding this comment.
This'll be the first hidden module / use of other-modules in hledger I think.
package.yaml also now lists Paths_hledger and autogen-modules explicitly, which is new. I think this is automatic and I'd prefer to leave that implicit as before.
In most of the packages we have other-modules: [] to prevent double compilation, sol/hpack#188 . Hopefully this won't cause double compilation.
It won't be possible for library users to browse the haddocks of these functions on hackage.
CompoundBalanceCommand.hs:460 still says setDisplayCommodityBare is in Hledger.Cli.Commands.Balance.
And FWIW:
AI> The new function's doc comment was copied unchanged. The comment on balanceSubReportAsSpreadsheetParts still says "for a MultiBalanceReport". It should say it's for a single subreport and spell out the rule for allCommodities: it must cover every row rendered. That rule is the reason for this PR.
|
On Thu, 24 Sep 2026, Simon Michael wrote:
@simonmichael commented on this pull request.
This'll be the first hidden module / use of other-modules in hledger I think.
it seems so
package.yaml also now lists Paths_hledger and autogen-modules
explicitly, which is new. I think this is automatic and I'd prefer to
leave that implicit as before.
That's what I tried first. But as soon as I add "Other-Modules: Internal",
hpack does no longer automatically fill in Paths_hledger in
autogen-modules and other-modules. Thus I had to add them manually.
It won't be possible for library users to browse the haddocks of these
functions on hackage.
You can still browse source code of internal modules as HTML.
|
…rom Cli.Commands.Balance that are now shared between Cli.Commands.Balance and CompoundBalanceCommand. Particularly, it hides all report generators with the allCommodities parameter. multiBalanceReportAsSpreadsheetParts: remove allCommodities parameter, maintain it in Internal.balanceSubReportAsSpreadsheetParts.
aed01ce to
bcf22a3
Compare
|
Ah, I see. Hopefully nothing obscure breaks as a result. I'll merge, thank you. |
Stack no longer warns "Ignoring unrecognized field $.library.autogen-modules". This is a followup to #2745. Listing other-modules explicitly stops hpack inferring Paths_hledger, so it has to be declared; generated-other-modules is hpack's field for that, and makes hpack emit both other-modules and autogen-modules. The generated hledger.cabal is unchanged.
as taken from Cli.Commands.Balance,
that are now shared between Cli.Commands.Balance and CompoundBalanceCommand.
Particularly, it hides all report generators with the allCommodities parameter.
multiBalanceReportAsSpreadsheetParts: remove allCommodities parameter, maintain it in Internal.balanceSubReportAsSpreadsheetParts.