hledger-lib 1.33 → 1.33.1
raw patch · 3 files changed
+84/−17 lines, 3 filesdep +doctestdep ~GlobPVP: major bump suggested
API removals or changes: PVP suggests a major version bump
Dependencies added: doctest
Dependency ranges changed: Glob
API changes (from Hackage documentation)
- Hledger.Data.Amount: showAmountsCostB :: Amount -> WideBuilder
+ Hledger.Data.Amount: showAmountCostB :: AmountFormat -> Amount -> WideBuilder
- Hledger.Data.Balancing: balancingOpts :: HasBalancingOpts c_a3IHQ => Lens' c_a3IHQ BalancingOpts
+ Hledger.Data.Balancing: balancingOpts :: HasBalancingOpts c_a3IGo => Lens' c_a3IGo BalancingOpts
- Hledger.Data.Balancing: class HasBalancingOpts c_a3IHQ
+ Hledger.Data.Balancing: class HasBalancingOpts c_a3IGo
- Hledger.Data.Balancing: commodity_styles :: HasBalancingOpts c_a3IHQ => Lens' c_a3IHQ (Maybe (Map CommoditySymbol AmountStyle))
+ Hledger.Data.Balancing: commodity_styles :: HasBalancingOpts c_a3IGo => Lens' c_a3IGo (Maybe (Map CommoditySymbol AmountStyle))
- Hledger.Data.Balancing: ignore_assertions :: HasBalancingOpts c_a3IHQ => Lens' c_a3IHQ Bool
+ Hledger.Data.Balancing: ignore_assertions :: HasBalancingOpts c_a3IGo => Lens' c_a3IGo Bool
- Hledger.Data.Balancing: infer_balancing_costs :: HasBalancingOpts c_a3IHQ => Lens' c_a3IHQ Bool
+ Hledger.Data.Balancing: infer_balancing_costs :: HasBalancingOpts c_a3IGo => Lens' c_a3IGo Bool
- Hledger.Read.Common: aliases :: HasInputOpts c_a3Xlq => Lens' c_a3Xlq [String]
+ Hledger.Read.Common: aliases :: HasInputOpts c_a3XjY => Lens' c_a3XjY [String]
- Hledger.Read.Common: anon__ :: HasInputOpts c_a3Xlq => Lens' c_a3Xlq Bool
+ Hledger.Read.Common: anon__ :: HasInputOpts c_a3XjY => Lens' c_a3XjY Bool
- Hledger.Read.Common: auto__ :: HasInputOpts c_a3Xlq => Lens' c_a3Xlq Bool
+ Hledger.Read.Common: auto__ :: HasInputOpts c_a3XjY => Lens' c_a3XjY Bool
- Hledger.Read.Common: balancingopts :: HasInputOpts c_a3Xlq => Lens' c_a3Xlq BalancingOpts
+ Hledger.Read.Common: balancingopts :: HasInputOpts c_a3XjY => Lens' c_a3XjY BalancingOpts
- Hledger.Read.Common: class HasInputOpts c_a3Xlq
+ Hledger.Read.Common: class HasInputOpts c_a3XjY
- Hledger.Read.Common: forecast :: HasInputOpts c_a3Xlq => Lens' c_a3Xlq (Maybe DateSpan)
+ Hledger.Read.Common: forecast :: HasInputOpts c_a3XjY => Lens' c_a3XjY (Maybe DateSpan)
- Hledger.Read.Common: infer_costs :: HasInputOpts c_a3Xlq => Lens' c_a3Xlq Bool
+ Hledger.Read.Common: infer_costs :: HasInputOpts c_a3XjY => Lens' c_a3XjY Bool
- Hledger.Read.Common: infer_equity :: HasInputOpts c_a3Xlq => Lens' c_a3Xlq Bool
+ Hledger.Read.Common: infer_equity :: HasInputOpts c_a3XjY => Lens' c_a3XjY Bool
- Hledger.Read.Common: inputOpts :: HasInputOpts c_a3Xlq => Lens' c_a3Xlq InputOpts
+ Hledger.Read.Common: inputOpts :: HasInputOpts c_a3XjY => Lens' c_a3XjY InputOpts
- Hledger.Read.Common: ioDay :: HasInputOpts c_a3Xlq => Lens' c_a3Xlq Day
+ Hledger.Read.Common: ioDay :: HasInputOpts c_a3XjY => Lens' c_a3XjY Day
- Hledger.Read.Common: mformat :: HasInputOpts c_a3Xlq => Lens' c_a3Xlq (Maybe StorageFormat)
+ Hledger.Read.Common: mformat :: HasInputOpts c_a3XjY => Lens' c_a3XjY (Maybe StorageFormat)
- Hledger.Read.Common: mrules_file :: HasInputOpts c_a3Xlq => Lens' c_a3Xlq (Maybe FilePath)
+ Hledger.Read.Common: mrules_file :: HasInputOpts c_a3XjY => Lens' c_a3XjY (Maybe FilePath)
- Hledger.Read.Common: new__ :: HasInputOpts c_a3Xlq => Lens' c_a3Xlq Bool
+ Hledger.Read.Common: new__ :: HasInputOpts c_a3XjY => Lens' c_a3XjY Bool
- Hledger.Read.Common: new_save :: HasInputOpts c_a3Xlq => Lens' c_a3Xlq Bool
+ Hledger.Read.Common: new_save :: HasInputOpts c_a3XjY => Lens' c_a3XjY Bool
- Hledger.Read.Common: pivot :: HasInputOpts c_a3Xlq => Lens' c_a3Xlq String
+ Hledger.Read.Common: pivot :: HasInputOpts c_a3XjY => Lens' c_a3XjY String
- Hledger.Read.Common: reportspan :: HasInputOpts c_a3Xlq => Lens' c_a3Xlq DateSpan
+ Hledger.Read.Common: reportspan :: HasInputOpts c_a3XjY => Lens' c_a3XjY DateSpan
- Hledger.Read.Common: strict :: HasInputOpts c_a3Xlq => Lens' c_a3Xlq Bool
+ Hledger.Read.Common: strict :: HasInputOpts c_a3XjY => Lens' c_a3XjY Bool
- Hledger.Read.Common: verbose_tags :: HasInputOpts c_a3Xlq => Lens' c_a3Xlq Bool
+ Hledger.Read.Common: verbose_tags :: HasInputOpts c_a3XjY => Lens' c_a3XjY Bool
- Hledger.Read.InputOptions: aliases :: HasInputOpts c_a3Xlq => Lens' c_a3Xlq [String]
+ Hledger.Read.InputOptions: aliases :: HasInputOpts c_a3XjY => Lens' c_a3XjY [String]
- Hledger.Read.InputOptions: anon__ :: HasInputOpts c_a3Xlq => Lens' c_a3Xlq Bool
+ Hledger.Read.InputOptions: anon__ :: HasInputOpts c_a3XjY => Lens' c_a3XjY Bool
- Hledger.Read.InputOptions: auto__ :: HasInputOpts c_a3Xlq => Lens' c_a3Xlq Bool
+ Hledger.Read.InputOptions: auto__ :: HasInputOpts c_a3XjY => Lens' c_a3XjY Bool
- Hledger.Read.InputOptions: balancingopts :: HasInputOpts c_a3Xlq => Lens' c_a3Xlq BalancingOpts
+ Hledger.Read.InputOptions: balancingopts :: HasInputOpts c_a3XjY => Lens' c_a3XjY BalancingOpts
- Hledger.Read.InputOptions: class HasInputOpts c_a3Xlq
+ Hledger.Read.InputOptions: class HasInputOpts c_a3XjY
- Hledger.Read.InputOptions: forecast :: HasInputOpts c_a3Xlq => Lens' c_a3Xlq (Maybe DateSpan)
+ Hledger.Read.InputOptions: forecast :: HasInputOpts c_a3XjY => Lens' c_a3XjY (Maybe DateSpan)
- Hledger.Read.InputOptions: infer_costs :: HasInputOpts c_a3Xlq => Lens' c_a3Xlq Bool
+ Hledger.Read.InputOptions: infer_costs :: HasInputOpts c_a3XjY => Lens' c_a3XjY Bool
- Hledger.Read.InputOptions: infer_equity :: HasInputOpts c_a3Xlq => Lens' c_a3Xlq Bool
+ Hledger.Read.InputOptions: infer_equity :: HasInputOpts c_a3XjY => Lens' c_a3XjY Bool
- Hledger.Read.InputOptions: inputOpts :: HasInputOpts c_a3Xlq => Lens' c_a3Xlq InputOpts
+ Hledger.Read.InputOptions: inputOpts :: HasInputOpts c_a3XjY => Lens' c_a3XjY InputOpts
- Hledger.Read.InputOptions: ioDay :: HasInputOpts c_a3Xlq => Lens' c_a3Xlq Day
+ Hledger.Read.InputOptions: ioDay :: HasInputOpts c_a3XjY => Lens' c_a3XjY Day
- Hledger.Read.InputOptions: mformat :: HasInputOpts c_a3Xlq => Lens' c_a3Xlq (Maybe StorageFormat)
+ Hledger.Read.InputOptions: mformat :: HasInputOpts c_a3XjY => Lens' c_a3XjY (Maybe StorageFormat)
- Hledger.Read.InputOptions: mrules_file :: HasInputOpts c_a3Xlq => Lens' c_a3Xlq (Maybe FilePath)
+ Hledger.Read.InputOptions: mrules_file :: HasInputOpts c_a3XjY => Lens' c_a3XjY (Maybe FilePath)
- Hledger.Read.InputOptions: new__ :: HasInputOpts c_a3Xlq => Lens' c_a3Xlq Bool
+ Hledger.Read.InputOptions: new__ :: HasInputOpts c_a3XjY => Lens' c_a3XjY Bool
- Hledger.Read.InputOptions: new_save :: HasInputOpts c_a3Xlq => Lens' c_a3Xlq Bool
+ Hledger.Read.InputOptions: new_save :: HasInputOpts c_a3XjY => Lens' c_a3XjY Bool
- Hledger.Read.InputOptions: pivot :: HasInputOpts c_a3Xlq => Lens' c_a3Xlq String
+ Hledger.Read.InputOptions: pivot :: HasInputOpts c_a3XjY => Lens' c_a3XjY String
- Hledger.Read.InputOptions: reportspan :: HasInputOpts c_a3Xlq => Lens' c_a3Xlq DateSpan
+ Hledger.Read.InputOptions: reportspan :: HasInputOpts c_a3XjY => Lens' c_a3XjY DateSpan
- Hledger.Read.InputOptions: strict :: HasInputOpts c_a3Xlq => Lens' c_a3Xlq Bool
+ Hledger.Read.InputOptions: strict :: HasInputOpts c_a3XjY => Lens' c_a3XjY Bool
- Hledger.Read.InputOptions: verbose_tags :: HasInputOpts c_a3Xlq => Lens' c_a3Xlq Bool
+ Hledger.Read.InputOptions: verbose_tags :: HasInputOpts c_a3XjY => Lens' c_a3XjY Bool
- Hledger.Reports.ReportOptions: accountlistmode :: HasReportOptsNoUpdate c_a42XO => Lens' c_a42XO AccountListMode
+ Hledger.Reports.ReportOptions: accountlistmode :: HasReportOptsNoUpdate c_a42Wm => Lens' c_a42Wm AccountListMode
- Hledger.Reports.ReportOptions: average :: HasReportOptsNoUpdate c_a42XO => Lens' c_a42XO Bool
+ Hledger.Reports.ReportOptions: average :: HasReportOptsNoUpdate c_a42Wm => Lens' c_a42Wm Bool
- Hledger.Reports.ReportOptions: balanceaccum :: HasReportOptsNoUpdate c_a42XO => Lens' c_a42XO BalanceAccumulation
+ Hledger.Reports.ReportOptions: balanceaccum :: HasReportOptsNoUpdate c_a42Wm => Lens' c_a42Wm BalanceAccumulation
- Hledger.Reports.ReportOptions: balancecalc :: HasReportOptsNoUpdate c_a42XO => Lens' c_a42XO BalanceCalculation
+ Hledger.Reports.ReportOptions: balancecalc :: HasReportOptsNoUpdate c_a42Wm => Lens' c_a42Wm BalanceCalculation
- Hledger.Reports.ReportOptions: budgetpat :: HasReportOptsNoUpdate c_a42XO => Lens' c_a42XO (Maybe Text)
+ Hledger.Reports.ReportOptions: budgetpat :: HasReportOptsNoUpdate c_a42Wm => Lens' c_a42Wm (Maybe Text)
- Hledger.Reports.ReportOptions: class HasReportOptsNoUpdate c_a42XO
+ Hledger.Reports.ReportOptions: class HasReportOptsNoUpdate c_a42Wm
- Hledger.Reports.ReportOptions: class HasReportSpec c_a441o
+ Hledger.Reports.ReportOptions: class HasReportSpec c_a43ZW
- Hledger.Reports.ReportOptions: color__ :: HasReportOptsNoUpdate c_a42XO => Lens' c_a42XO Bool
+ Hledger.Reports.ReportOptions: color__ :: HasReportOptsNoUpdate c_a42Wm => Lens' c_a42Wm Bool
- Hledger.Reports.ReportOptions: conversionop :: HasReportOptsNoUpdate c_a42XO => Lens' c_a42XO (Maybe ConversionOp)
+ Hledger.Reports.ReportOptions: conversionop :: HasReportOptsNoUpdate c_a42Wm => Lens' c_a42Wm (Maybe ConversionOp)
- Hledger.Reports.ReportOptions: date2NoUpdate :: HasReportOptsNoUpdate c_a42XO => Lens' c_a42XO Bool
+ Hledger.Reports.ReportOptions: date2NoUpdate :: HasReportOptsNoUpdate c_a42Wm => Lens' c_a42Wm Bool
- Hledger.Reports.ReportOptions: declared :: HasReportOptsNoUpdate c_a42XO => Lens' c_a42XO Bool
+ Hledger.Reports.ReportOptions: declared :: HasReportOptsNoUpdate c_a42Wm => Lens' c_a42Wm Bool
- Hledger.Reports.ReportOptions: depthNoUpdate :: HasReportOptsNoUpdate c_a42XO => Lens' c_a42XO (Maybe Int)
+ Hledger.Reports.ReportOptions: depthNoUpdate :: HasReportOptsNoUpdate c_a42Wm => Lens' c_a42Wm (Maybe Int)
- Hledger.Reports.ReportOptions: drop__ :: HasReportOptsNoUpdate c_a42XO => Lens' c_a42XO Int
+ Hledger.Reports.ReportOptions: drop__ :: HasReportOptsNoUpdate c_a42Wm => Lens' c_a42Wm Int
- Hledger.Reports.ReportOptions: empty__ :: HasReportOptsNoUpdate c_a42XO => Lens' c_a42XO Bool
+ Hledger.Reports.ReportOptions: empty__ :: HasReportOptsNoUpdate c_a42Wm => Lens' c_a42Wm Bool
- Hledger.Reports.ReportOptions: format :: HasReportOptsNoUpdate c_a42XO => Lens' c_a42XO StringFormat
+ Hledger.Reports.ReportOptions: format :: HasReportOptsNoUpdate c_a42Wm => Lens' c_a42Wm StringFormat
- Hledger.Reports.ReportOptions: infer_prices :: HasReportOptsNoUpdate c_a42XO => Lens' c_a42XO Bool
+ Hledger.Reports.ReportOptions: infer_prices :: HasReportOptsNoUpdate c_a42Wm => Lens' c_a42Wm Bool
- Hledger.Reports.ReportOptions: interval :: HasReportOptsNoUpdate c_a42XO => Lens' c_a42XO Interval
+ Hledger.Reports.ReportOptions: interval :: HasReportOptsNoUpdate c_a42Wm => Lens' c_a42Wm Interval
- Hledger.Reports.ReportOptions: invert :: HasReportOptsNoUpdate c_a42XO => Lens' c_a42XO Bool
+ Hledger.Reports.ReportOptions: invert :: HasReportOptsNoUpdate c_a42Wm => Lens' c_a42Wm Bool
- Hledger.Reports.ReportOptions: layout :: HasReportOptsNoUpdate c_a42XO => Lens' c_a42XO Layout
+ Hledger.Reports.ReportOptions: layout :: HasReportOptsNoUpdate c_a42Wm => Lens' c_a42Wm Layout
- Hledger.Reports.ReportOptions: no_elide :: HasReportOptsNoUpdate c_a42XO => Lens' c_a42XO Bool
+ Hledger.Reports.ReportOptions: no_elide :: HasReportOptsNoUpdate c_a42Wm => Lens' c_a42Wm Bool
- Hledger.Reports.ReportOptions: no_total :: HasReportOptsNoUpdate c_a42XO => Lens' c_a42XO Bool
+ Hledger.Reports.ReportOptions: no_total :: HasReportOptsNoUpdate c_a42Wm => Lens' c_a42Wm Bool
- Hledger.Reports.ReportOptions: normalbalance :: HasReportOptsNoUpdate c_a42XO => Lens' c_a42XO (Maybe NormalSign)
+ Hledger.Reports.ReportOptions: normalbalance :: HasReportOptsNoUpdate c_a42Wm => Lens' c_a42Wm (Maybe NormalSign)
- Hledger.Reports.ReportOptions: percent :: HasReportOptsNoUpdate c_a42XO => Lens' c_a42XO Bool
+ Hledger.Reports.ReportOptions: percent :: HasReportOptsNoUpdate c_a42Wm => Lens' c_a42Wm Bool
- Hledger.Reports.ReportOptions: periodNoUpdate :: HasReportOptsNoUpdate c_a42XO => Lens' c_a42XO Period
+ Hledger.Reports.ReportOptions: periodNoUpdate :: HasReportOptsNoUpdate c_a42Wm => Lens' c_a42Wm Period
- Hledger.Reports.ReportOptions: pretty :: HasReportOptsNoUpdate c_a42XO => Lens' c_a42XO Bool
+ Hledger.Reports.ReportOptions: pretty :: HasReportOptsNoUpdate c_a42Wm => Lens' c_a42Wm Bool
- Hledger.Reports.ReportOptions: querystringNoUpdate :: HasReportOptsNoUpdate c_a42XO => Lens' c_a42XO [Text]
+ Hledger.Reports.ReportOptions: querystringNoUpdate :: HasReportOptsNoUpdate c_a42Wm => Lens' c_a42Wm [Text]
- Hledger.Reports.ReportOptions: realNoUpdate :: HasReportOptsNoUpdate c_a42XO => Lens' c_a42XO Bool
+ Hledger.Reports.ReportOptions: realNoUpdate :: HasReportOptsNoUpdate c_a42Wm => Lens' c_a42Wm Bool
- Hledger.Reports.ReportOptions: related :: HasReportOptsNoUpdate c_a42XO => Lens' c_a42XO Bool
+ Hledger.Reports.ReportOptions: related :: HasReportOptsNoUpdate c_a42Wm => Lens' c_a42Wm Bool
- Hledger.Reports.ReportOptions: reportOptsNoUpdate :: HasReportOptsNoUpdate c_a42XO => Lens' c_a42XO ReportOpts
+ Hledger.Reports.ReportOptions: reportOptsNoUpdate :: HasReportOptsNoUpdate c_a42Wm => Lens' c_a42Wm ReportOpts
- Hledger.Reports.ReportOptions: reportSpec :: HasReportSpec c_a441o => Lens' c_a441o ReportSpec
+ Hledger.Reports.ReportOptions: reportSpec :: HasReportSpec c_a43ZW => Lens' c_a43ZW ReportSpec
- Hledger.Reports.ReportOptions: row_total :: HasReportOptsNoUpdate c_a42XO => Lens' c_a42XO Bool
+ Hledger.Reports.ReportOptions: row_total :: HasReportOptsNoUpdate c_a42Wm => Lens' c_a42Wm Bool
- Hledger.Reports.ReportOptions: rsDay :: HasReportSpec c_a441o => Lens' c_a441o Day
+ Hledger.Reports.ReportOptions: rsDay :: HasReportSpec c_a43ZW => Lens' c_a43ZW Day
- Hledger.Reports.ReportOptions: rsQuery :: HasReportSpec c_a441o => Lens' c_a441o Query
+ Hledger.Reports.ReportOptions: rsQuery :: HasReportSpec c_a43ZW => Lens' c_a43ZW Query
- Hledger.Reports.ReportOptions: rsQueryOpts :: HasReportSpec c_a441o => Lens' c_a441o [QueryOpt]
+ Hledger.Reports.ReportOptions: rsQueryOpts :: HasReportSpec c_a43ZW => Lens' c_a43ZW [QueryOpt]
- Hledger.Reports.ReportOptions: rsReportOpts :: HasReportSpec c_a441o => Lens' c_a441o ReportOpts
+ Hledger.Reports.ReportOptions: rsReportOpts :: HasReportSpec c_a43ZW => Lens' c_a43ZW ReportOpts
- Hledger.Reports.ReportOptions: show_costs :: HasReportOptsNoUpdate c_a42XO => Lens' c_a42XO Bool
+ Hledger.Reports.ReportOptions: show_costs :: HasReportOptsNoUpdate c_a42Wm => Lens' c_a42Wm Bool
- Hledger.Reports.ReportOptions: sort_amount :: HasReportOptsNoUpdate c_a42XO => Lens' c_a42XO Bool
+ Hledger.Reports.ReportOptions: sort_amount :: HasReportOptsNoUpdate c_a42Wm => Lens' c_a42Wm Bool
- Hledger.Reports.ReportOptions: statusesNoUpdate :: HasReportOptsNoUpdate c_a42XO => Lens' c_a42XO [Status]
+ Hledger.Reports.ReportOptions: statusesNoUpdate :: HasReportOptsNoUpdate c_a42Wm => Lens' c_a42Wm [Status]
- Hledger.Reports.ReportOptions: summary_only :: HasReportOptsNoUpdate c_a42XO => Lens' c_a42XO Bool
+ Hledger.Reports.ReportOptions: summary_only :: HasReportOptsNoUpdate c_a42Wm => Lens' c_a42Wm Bool
- Hledger.Reports.ReportOptions: transpose__ :: HasReportOptsNoUpdate c_a42XO => Lens' c_a42XO Bool
+ Hledger.Reports.ReportOptions: transpose__ :: HasReportOptsNoUpdate c_a42Wm => Lens' c_a42Wm Bool
- Hledger.Reports.ReportOptions: txn_dates :: HasReportOptsNoUpdate c_a42XO => Lens' c_a42XO Bool
+ Hledger.Reports.ReportOptions: txn_dates :: HasReportOptsNoUpdate c_a42Wm => Lens' c_a42Wm Bool
- Hledger.Reports.ReportOptions: value :: HasReportOptsNoUpdate c_a42XO => Lens' c_a42XO (Maybe ValuationType)
+ Hledger.Reports.ReportOptions: value :: HasReportOptsNoUpdate c_a42Wm => Lens' c_a42Wm (Maybe ValuationType)
Files
- CHANGES.md +6/−0
- Hledger/Data/Amount.hs +16/−16
- hledger-lib.cabal +62/−1
CHANGES.md view
@@ -21,6 +21,11 @@ Internal/api/developer-ish changes in the hledger-lib (and hledger) packages. For user-visible changes, see the hledger package changelog. +# 1.33.1 2024-05-02++- Updates for hledger 1.33.1++ # 1.33 2024-04-18 Breaking changes@@ -57,6 +62,7 @@ - distinguish oneLineFmt and oneLineNoCostFmt; add fullZeroFmt - matchedPostingsBeforeAndDuring: improve debug output +[#2177]: https://github.com/simonmichael/hledger/issues/2177 # 1.32.3 2024-01-28
Hledger/Data/Amount.hs view
@@ -87,7 +87,7 @@ showAmount, showAmountWith, showAmountB,- showAmountsCostB,+ showAmountCostB, cshowAmount, showAmountWithZeroCommodity, showAmountDebug,@@ -633,19 +633,6 @@ -- Amount rendering --- Show an amount's cost as @ UNITCOST or @@ TOTALCOST (builder version).-showAmountsCostB :: Amount -> WideBuilder-showAmountsCostB amt = case acost amt of- Nothing -> mempty- Just (UnitCost pa) -> WideBuilder (TB.fromString " @ ") 3 <> showAmountB defaultFmt{displayZeroCommodity=True} pa- Just (TotalCost pa) -> WideBuilder (TB.fromString " @@ ") 4 <> showAmountB defaultFmt{displayZeroCommodity=True} (sign pa)- where sign = if aquantity amt < 0 then negate else id--showAmountCostDebug :: Maybe AmountCost -> String-showAmountCostDebug Nothing = ""-showAmountCostDebug (Just (UnitCost pa)) = " @ " ++ showAmountDebug pa-showAmountCostDebug (Just (TotalCost pa)) = " @@ " ++ showAmountDebug pa- -- | Render an amount using its display style and the default amount format. -- Zero-equivalent amounts are shown as just \"0\". -- The special "missing" amount is shown as the empty string.@@ -662,7 +649,7 @@ showAmountB :: AmountFormat -> Amount -> WideBuilder showAmountB _ Amount{acommodity="AUTO"} = mempty showAmountB- AmountFormat{displayCommodity, displayZeroCommodity, displayDigitGroups+ afmt@AmountFormat{displayCommodity, displayZeroCommodity, displayDigitGroups ,displayForceDecimalMark, displayCost, displayColour} a@Amount{astyle=style} = color $ case ascommodityside style of@@ -676,7 +663,20 @@ | amountLooksZero a && not displayZeroCommodity = (WideBuilder (TB.singleton '0') 1, "") | otherwise = (quantity, quoteCommoditySymbolIfNeeded $ acommodity a) space = if not (T.null comm) && ascommodityspaced style then WideBuilder (TB.singleton ' ') 1 else mempty- cost = if displayCost then showAmountsCostB a else mempty+ cost = if displayCost then showAmountCostB afmt a else mempty++-- Show an amount's cost as @ UNITCOST or @@ TOTALCOST (builder version).+showAmountCostB :: AmountFormat -> Amount -> WideBuilder+showAmountCostB afmt amt = case acost amt of+ Nothing -> mempty+ Just (UnitCost pa) -> WideBuilder (TB.fromString " @ ") 3 <> showAmountB afmt pa+ Just (TotalCost pa) -> WideBuilder (TB.fromString " @@ ") 4 <> showAmountB afmt (sign pa)+ where sign = if aquantity amt < 0 then negate else id++showAmountCostDebug :: Maybe AmountCost -> String+showAmountCostDebug Nothing = ""+showAmountCostDebug (Just (UnitCost pa)) = " @ " ++ showAmountDebug pa+showAmountCostDebug (Just (TotalCost pa)) = " @@ " ++ showAmountDebug pa -- | Colour version. For a negative amount, adds ANSI codes to change the colour, -- currently to hard-coded red.
hledger-lib.cabal view
@@ -5,7 +5,7 @@ -- see: https://github.com/sol/hpack name: hledger-lib-version: 1.33+version: 1.33.1 synopsis: A library providing the core functionality of hledger description: This library contains hledger's core functionality. It is used by most hledger* packages so that they support the same@@ -156,6 +156,67 @@ if (!(os(windows))) build-depends: pager >=0.1.1.0++test-suite doctest+ type: exitcode-stdio-1.0+ main-is: doctests.hs+ hs-source-dirs:+ ./+ test+ ghc-options: -Wall -Wno-incomplete-uni-patterns -Wno-missing-signatures -Wno-orphans -Wno-type-defaults -Wno-unused-do-bind+ build-depends:+ Decimal >=0.5.1+ , Glob >=0.7+ , aeson >=1 && <2.3+ , aeson-pretty+ , ansi-terminal >=0.9+ , array+ , base >=4.14 && <4.20+ , base-compat+ , blaze-markup >=0.5.1+ , bytestring+ , call-stack+ , cassava+ , cassava-megaparsec+ , cmdargs >=0.10+ , colour >=2.3.6+ , containers >=0.5.9+ , data-default >=0.5+ , deepseq+ , directory+ , doclayout >=0.3 && <0.5+ , doctest >=0.18.1+ , extra >=1.6.3+ , file-embed >=0.0.10+ , filepath+ , hashtables >=1.2.3.1+ , megaparsec >=7.0.0 && <9.7+ , microlens >=0.4+ , microlens-th >=0.4+ , mtl >=2.2.1+ , parser-combinators >=0.4.0+ , pretty-simple >4 && <5+ , regex-tdfa+ , safe >=0.3.20+ , tabular >=0.2+ , tasty >=1.2.3+ , tasty-hunit >=0.10.0.2+ , template-haskell+ , terminal-size >=0.3.3+ , text >=1.2.4.1+ , text-ansi >=0.2.1+ , time >=1.5+ , timeit+ , transformers >=0.2+ , uglymemo+ , unordered-containers >=0.2+ , utf8-string >=0.3.5+ default-language: Haskell2010+ if (!(os(windows)))+ build-depends:+ pager >=0.1.1.0+ if impl(ghc >= 9.0) && impl(ghc < 9.2)+ buildable: False test-suite unittest type: exitcode-stdio-1.0