Skip to content

Balance.Internal: new module for internal functions - #2745

Merged
simonmichael merged 1 commit into
hledgerorg:mainfrom
thielema:balance-internal
Sep 24, 2026
Merged

simonmichael merged 1 commit into
hledgerorg:mainfrom
thielema:balance-internal

Conversation

@thielema

Copy link
Copy Markdown
Contributor

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.

@thielema

Copy link
Copy Markdown
Contributor Author

multiBalanceRowAsCsvText and multiBalanceRowAsText still have the allCommodities parameters, but they do not have AmountFormat parameters that conflict with allCommodities.

multiBalanceRowAsCsvText was introduced before me by 7ccf743

@simonmichael simonmichael left a comment •

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

@thielema

thielema commented Sep 24, 2026 via email

Copy link
Copy Markdown
Contributor Author

…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.
@simonmichael

Copy link
Copy Markdown
Member

Ah, I see. Hopefully nothing obscure breaks as a result. I'll merge, thank you.

@simonmichael
simonmichael merged commit 119ab7f into hledgerorg:main Sep 24, 2026
2 checks passed
simonmichael added a commit that referenced this pull request Sep 26, 2026
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.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants