hledger-lib 1.32.1 → 1.32.2
raw patch · 11 files changed
+137/−96 lines, 11 filesPVP: major bump suggested
API removals or changes: PVP suggests a major version bump
API changes (from Hackage documentation)
- Hledger.Data.Amount: [displayAddDecimalMark] :: AmountDisplayOpts -> Bool
- Hledger.Data.Amount: [displayOrder] :: AmountDisplayOpts -> Maybe [CommoditySymbol]
- Hledger.Data.Amount: [displayPrice] :: AmountDisplayOpts -> Bool
- Hledger.Data.Amount: [displayThousandsSep] :: AmountDisplayOpts -> Bool
- Hledger.Data.Amount: noPrice :: AmountDisplayOpts
+ Hledger.Data.Amount: [displayCommodityOrder] :: AmountDisplayOpts -> Maybe [CommoditySymbol]
+ Hledger.Data.Amount: [displayCommodity] :: AmountDisplayOpts -> Bool
+ Hledger.Data.Amount: [displayCost] :: AmountDisplayOpts -> Bool
+ Hledger.Data.Amount: [displayDigitGroups] :: AmountDisplayOpts -> Bool
+ Hledger.Data.Amount: [displayForceDecimalMark] :: AmountDisplayOpts -> Bool
+ Hledger.Data.Amount: noCost :: AmountDisplayOpts
+ Hledger.Data.RawOptions: mkRawOpts :: [(String, String)] -> RawOpts
- Hledger.Data.Amount: AmountDisplayOpts :: Bool -> Bool -> Bool -> Bool -> Bool -> Bool -> Maybe Int -> Maybe Int -> Maybe [CommoditySymbol] -> AmountDisplayOpts
+ Hledger.Data.Amount: AmountDisplayOpts :: Bool -> Bool -> Maybe [CommoditySymbol] -> Bool -> Bool -> Bool -> Maybe Int -> Maybe Int -> Bool -> Bool -> AmountDisplayOpts
- Hledger.Data.Balancing: balancingOpts :: HasBalancingOpts c_a3LeT => Lens' c_a3LeT BalancingOpts
+ Hledger.Data.Balancing: balancingOpts :: HasBalancingOpts c_a3Ll5 => Lens' c_a3Ll5 BalancingOpts
- Hledger.Data.Balancing: class HasBalancingOpts c_a3LeT
+ Hledger.Data.Balancing: class HasBalancingOpts c_a3Ll5
- Hledger.Data.Balancing: commodity_styles :: HasBalancingOpts c_a3LeT => Lens' c_a3LeT (Maybe (Map CommoditySymbol AmountStyle))
+ Hledger.Data.Balancing: commodity_styles :: HasBalancingOpts c_a3Ll5 => Lens' c_a3Ll5 (Maybe (Map CommoditySymbol AmountStyle))
- Hledger.Data.Balancing: ignore_assertions :: HasBalancingOpts c_a3LeT => Lens' c_a3LeT Bool
+ Hledger.Data.Balancing: ignore_assertions :: HasBalancingOpts c_a3Ll5 => Lens' c_a3Ll5 Bool
- Hledger.Data.Balancing: infer_balancing_costs :: HasBalancingOpts c_a3LeT => Lens' c_a3LeT Bool
+ Hledger.Data.Balancing: infer_balancing_costs :: HasBalancingOpts c_a3Ll5 => Lens' c_a3Ll5 Bool
- Hledger.Read.Common: aliases :: HasInputOpts c_a3ZN2 => Lens' c_a3ZN2 [String]
+ Hledger.Read.Common: aliases :: HasInputOpts c_a3ZTe => Lens' c_a3ZTe [String]
- Hledger.Read.Common: anon__ :: HasInputOpts c_a3ZN2 => Lens' c_a3ZN2 Bool
+ Hledger.Read.Common: anon__ :: HasInputOpts c_a3ZTe => Lens' c_a3ZTe Bool
- Hledger.Read.Common: auto__ :: HasInputOpts c_a3ZN2 => Lens' c_a3ZN2 Bool
+ Hledger.Read.Common: auto__ :: HasInputOpts c_a3ZTe => Lens' c_a3ZTe Bool
- Hledger.Read.Common: balancingopts :: HasInputOpts c_a3ZN2 => Lens' c_a3ZN2 BalancingOpts
+ Hledger.Read.Common: balancingopts :: HasInputOpts c_a3ZTe => Lens' c_a3ZTe BalancingOpts
- Hledger.Read.Common: class HasInputOpts c_a3ZN2
+ Hledger.Read.Common: class HasInputOpts c_a3ZTe
- Hledger.Read.Common: forecast :: HasInputOpts c_a3ZN2 => Lens' c_a3ZN2 (Maybe DateSpan)
+ Hledger.Read.Common: forecast :: HasInputOpts c_a3ZTe => Lens' c_a3ZTe (Maybe DateSpan)
- Hledger.Read.Common: infer_costs :: HasInputOpts c_a3ZN2 => Lens' c_a3ZN2 Bool
+ Hledger.Read.Common: infer_costs :: HasInputOpts c_a3ZTe => Lens' c_a3ZTe Bool
- Hledger.Read.Common: infer_equity :: HasInputOpts c_a3ZN2 => Lens' c_a3ZN2 Bool
+ Hledger.Read.Common: infer_equity :: HasInputOpts c_a3ZTe => Lens' c_a3ZTe Bool
- Hledger.Read.Common: inputOpts :: HasInputOpts c_a3ZN2 => Lens' c_a3ZN2 InputOpts
+ Hledger.Read.Common: inputOpts :: HasInputOpts c_a3ZTe => Lens' c_a3ZTe InputOpts
- Hledger.Read.Common: ioDay :: HasInputOpts c_a3ZN2 => Lens' c_a3ZN2 Day
+ Hledger.Read.Common: ioDay :: HasInputOpts c_a3ZTe => Lens' c_a3ZTe Day
- Hledger.Read.Common: mformat :: HasInputOpts c_a3ZN2 => Lens' c_a3ZN2 (Maybe StorageFormat)
+ Hledger.Read.Common: mformat :: HasInputOpts c_a3ZTe => Lens' c_a3ZTe (Maybe StorageFormat)
- Hledger.Read.Common: mrules_file :: HasInputOpts c_a3ZN2 => Lens' c_a3ZN2 (Maybe FilePath)
+ Hledger.Read.Common: mrules_file :: HasInputOpts c_a3ZTe => Lens' c_a3ZTe (Maybe FilePath)
- Hledger.Read.Common: new__ :: HasInputOpts c_a3ZN2 => Lens' c_a3ZN2 Bool
+ Hledger.Read.Common: new__ :: HasInputOpts c_a3ZTe => Lens' c_a3ZTe Bool
- Hledger.Read.Common: new_save :: HasInputOpts c_a3ZN2 => Lens' c_a3ZN2 Bool
+ Hledger.Read.Common: new_save :: HasInputOpts c_a3ZTe => Lens' c_a3ZTe Bool
- Hledger.Read.Common: pivot :: HasInputOpts c_a3ZN2 => Lens' c_a3ZN2 String
+ Hledger.Read.Common: pivot :: HasInputOpts c_a3ZTe => Lens' c_a3ZTe String
- Hledger.Read.Common: reportspan :: HasInputOpts c_a3ZN2 => Lens' c_a3ZN2 DateSpan
+ Hledger.Read.Common: reportspan :: HasInputOpts c_a3ZTe => Lens' c_a3ZTe DateSpan
- Hledger.Read.Common: strict :: HasInputOpts c_a3ZN2 => Lens' c_a3ZN2 Bool
+ Hledger.Read.Common: strict :: HasInputOpts c_a3ZTe => Lens' c_a3ZTe Bool
- Hledger.Read.Common: verbose_tags :: HasInputOpts c_a3ZN2 => Lens' c_a3ZN2 Bool
+ Hledger.Read.Common: verbose_tags :: HasInputOpts c_a3ZTe => Lens' c_a3ZTe Bool
- Hledger.Read.InputOptions: aliases :: HasInputOpts c_a3ZN2 => Lens' c_a3ZN2 [String]
+ Hledger.Read.InputOptions: aliases :: HasInputOpts c_a3ZTe => Lens' c_a3ZTe [String]
- Hledger.Read.InputOptions: anon__ :: HasInputOpts c_a3ZN2 => Lens' c_a3ZN2 Bool
+ Hledger.Read.InputOptions: anon__ :: HasInputOpts c_a3ZTe => Lens' c_a3ZTe Bool
- Hledger.Read.InputOptions: auto__ :: HasInputOpts c_a3ZN2 => Lens' c_a3ZN2 Bool
+ Hledger.Read.InputOptions: auto__ :: HasInputOpts c_a3ZTe => Lens' c_a3ZTe Bool
- Hledger.Read.InputOptions: balancingopts :: HasInputOpts c_a3ZN2 => Lens' c_a3ZN2 BalancingOpts
+ Hledger.Read.InputOptions: balancingopts :: HasInputOpts c_a3ZTe => Lens' c_a3ZTe BalancingOpts
- Hledger.Read.InputOptions: class HasInputOpts c_a3ZN2
+ Hledger.Read.InputOptions: class HasInputOpts c_a3ZTe
- Hledger.Read.InputOptions: forecast :: HasInputOpts c_a3ZN2 => Lens' c_a3ZN2 (Maybe DateSpan)
+ Hledger.Read.InputOptions: forecast :: HasInputOpts c_a3ZTe => Lens' c_a3ZTe (Maybe DateSpan)
- Hledger.Read.InputOptions: infer_costs :: HasInputOpts c_a3ZN2 => Lens' c_a3ZN2 Bool
+ Hledger.Read.InputOptions: infer_costs :: HasInputOpts c_a3ZTe => Lens' c_a3ZTe Bool
- Hledger.Read.InputOptions: infer_equity :: HasInputOpts c_a3ZN2 => Lens' c_a3ZN2 Bool
+ Hledger.Read.InputOptions: infer_equity :: HasInputOpts c_a3ZTe => Lens' c_a3ZTe Bool
- Hledger.Read.InputOptions: inputOpts :: HasInputOpts c_a3ZN2 => Lens' c_a3ZN2 InputOpts
+ Hledger.Read.InputOptions: inputOpts :: HasInputOpts c_a3ZTe => Lens' c_a3ZTe InputOpts
- Hledger.Read.InputOptions: ioDay :: HasInputOpts c_a3ZN2 => Lens' c_a3ZN2 Day
+ Hledger.Read.InputOptions: ioDay :: HasInputOpts c_a3ZTe => Lens' c_a3ZTe Day
- Hledger.Read.InputOptions: mformat :: HasInputOpts c_a3ZN2 => Lens' c_a3ZN2 (Maybe StorageFormat)
+ Hledger.Read.InputOptions: mformat :: HasInputOpts c_a3ZTe => Lens' c_a3ZTe (Maybe StorageFormat)
- Hledger.Read.InputOptions: mrules_file :: HasInputOpts c_a3ZN2 => Lens' c_a3ZN2 (Maybe FilePath)
+ Hledger.Read.InputOptions: mrules_file :: HasInputOpts c_a3ZTe => Lens' c_a3ZTe (Maybe FilePath)
- Hledger.Read.InputOptions: new__ :: HasInputOpts c_a3ZN2 => Lens' c_a3ZN2 Bool
+ Hledger.Read.InputOptions: new__ :: HasInputOpts c_a3ZTe => Lens' c_a3ZTe Bool
- Hledger.Read.InputOptions: new_save :: HasInputOpts c_a3ZN2 => Lens' c_a3ZN2 Bool
+ Hledger.Read.InputOptions: new_save :: HasInputOpts c_a3ZTe => Lens' c_a3ZTe Bool
- Hledger.Read.InputOptions: pivot :: HasInputOpts c_a3ZN2 => Lens' c_a3ZN2 String
+ Hledger.Read.InputOptions: pivot :: HasInputOpts c_a3ZTe => Lens' c_a3ZTe String
- Hledger.Read.InputOptions: reportspan :: HasInputOpts c_a3ZN2 => Lens' c_a3ZN2 DateSpan
+ Hledger.Read.InputOptions: reportspan :: HasInputOpts c_a3ZTe => Lens' c_a3ZTe DateSpan
- Hledger.Read.InputOptions: strict :: HasInputOpts c_a3ZN2 => Lens' c_a3ZN2 Bool
+ Hledger.Read.InputOptions: strict :: HasInputOpts c_a3ZTe => Lens' c_a3ZTe Bool
- Hledger.Read.InputOptions: verbose_tags :: HasInputOpts c_a3ZN2 => Lens' c_a3ZN2 Bool
+ Hledger.Read.InputOptions: verbose_tags :: HasInputOpts c_a3ZTe => Lens' c_a3ZTe Bool
- Hledger.Reports.ReportOptions: accountlistmode :: HasReportOptsNoUpdate c_a47Pe => Lens' c_a47Pe AccountListMode
+ Hledger.Reports.ReportOptions: accountlistmode :: HasReportOptsNoUpdate c_a47Vq => Lens' c_a47Vq AccountListMode
- Hledger.Reports.ReportOptions: average :: HasReportOptsNoUpdate c_a47Pe => Lens' c_a47Pe Bool
+ Hledger.Reports.ReportOptions: average :: HasReportOptsNoUpdate c_a47Vq => Lens' c_a47Vq Bool
- Hledger.Reports.ReportOptions: balanceaccum :: HasReportOptsNoUpdate c_a47Pe => Lens' c_a47Pe BalanceAccumulation
+ Hledger.Reports.ReportOptions: balanceaccum :: HasReportOptsNoUpdate c_a47Vq => Lens' c_a47Vq BalanceAccumulation
- Hledger.Reports.ReportOptions: balancecalc :: HasReportOptsNoUpdate c_a47Pe => Lens' c_a47Pe BalanceCalculation
+ Hledger.Reports.ReportOptions: balancecalc :: HasReportOptsNoUpdate c_a47Vq => Lens' c_a47Vq BalanceCalculation
- Hledger.Reports.ReportOptions: budgetpat :: HasReportOptsNoUpdate c_a47Pe => Lens' c_a47Pe (Maybe Text)
+ Hledger.Reports.ReportOptions: budgetpat :: HasReportOptsNoUpdate c_a47Vq => Lens' c_a47Vq (Maybe Text)
- Hledger.Reports.ReportOptions: class HasReportOptsNoUpdate c_a47Pe
+ Hledger.Reports.ReportOptions: class HasReportOptsNoUpdate c_a47Vq
- Hledger.Reports.ReportOptions: class HasReportSpec c_a48PW
+ Hledger.Reports.ReportOptions: class HasReportSpec c_a48W8
- Hledger.Reports.ReportOptions: color__ :: HasReportOptsNoUpdate c_a47Pe => Lens' c_a47Pe Bool
+ Hledger.Reports.ReportOptions: color__ :: HasReportOptsNoUpdate c_a47Vq => Lens' c_a47Vq Bool
- Hledger.Reports.ReportOptions: conversionop :: HasReportOptsNoUpdate c_a47Pe => Lens' c_a47Pe (Maybe ConversionOp)
+ Hledger.Reports.ReportOptions: conversionop :: HasReportOptsNoUpdate c_a47Vq => Lens' c_a47Vq (Maybe ConversionOp)
- Hledger.Reports.ReportOptions: date2NoUpdate :: HasReportOptsNoUpdate c_a47Pe => Lens' c_a47Pe Bool
+ Hledger.Reports.ReportOptions: date2NoUpdate :: HasReportOptsNoUpdate c_a47Vq => Lens' c_a47Vq Bool
- Hledger.Reports.ReportOptions: declared :: HasReportOptsNoUpdate c_a47Pe => Lens' c_a47Pe Bool
+ Hledger.Reports.ReportOptions: declared :: HasReportOptsNoUpdate c_a47Vq => Lens' c_a47Vq Bool
- Hledger.Reports.ReportOptions: depthNoUpdate :: HasReportOptsNoUpdate c_a47Pe => Lens' c_a47Pe (Maybe Int)
+ Hledger.Reports.ReportOptions: depthNoUpdate :: HasReportOptsNoUpdate c_a47Vq => Lens' c_a47Vq (Maybe Int)
- Hledger.Reports.ReportOptions: drop__ :: HasReportOptsNoUpdate c_a47Pe => Lens' c_a47Pe Int
+ Hledger.Reports.ReportOptions: drop__ :: HasReportOptsNoUpdate c_a47Vq => Lens' c_a47Vq Int
- Hledger.Reports.ReportOptions: empty__ :: HasReportOptsNoUpdate c_a47Pe => Lens' c_a47Pe Bool
+ Hledger.Reports.ReportOptions: empty__ :: HasReportOptsNoUpdate c_a47Vq => Lens' c_a47Vq Bool
- Hledger.Reports.ReportOptions: format :: HasReportOptsNoUpdate c_a47Pe => Lens' c_a47Pe StringFormat
+ Hledger.Reports.ReportOptions: format :: HasReportOptsNoUpdate c_a47Vq => Lens' c_a47Vq StringFormat
- Hledger.Reports.ReportOptions: infer_prices :: HasReportOptsNoUpdate c_a47Pe => Lens' c_a47Pe Bool
+ Hledger.Reports.ReportOptions: infer_prices :: HasReportOptsNoUpdate c_a47Vq => Lens' c_a47Vq Bool
- Hledger.Reports.ReportOptions: interval :: HasReportOptsNoUpdate c_a47Pe => Lens' c_a47Pe Interval
+ Hledger.Reports.ReportOptions: interval :: HasReportOptsNoUpdate c_a47Vq => Lens' c_a47Vq Interval
- Hledger.Reports.ReportOptions: invert :: HasReportOptsNoUpdate c_a47Pe => Lens' c_a47Pe Bool
+ Hledger.Reports.ReportOptions: invert :: HasReportOptsNoUpdate c_a47Vq => Lens' c_a47Vq Bool
- Hledger.Reports.ReportOptions: layout :: HasReportOptsNoUpdate c_a47Pe => Lens' c_a47Pe Layout
+ Hledger.Reports.ReportOptions: layout :: HasReportOptsNoUpdate c_a47Vq => Lens' c_a47Vq Layout
- Hledger.Reports.ReportOptions: no_elide :: HasReportOptsNoUpdate c_a47Pe => Lens' c_a47Pe Bool
+ Hledger.Reports.ReportOptions: no_elide :: HasReportOptsNoUpdate c_a47Vq => Lens' c_a47Vq Bool
- Hledger.Reports.ReportOptions: no_total :: HasReportOptsNoUpdate c_a47Pe => Lens' c_a47Pe Bool
+ Hledger.Reports.ReportOptions: no_total :: HasReportOptsNoUpdate c_a47Vq => Lens' c_a47Vq Bool
- Hledger.Reports.ReportOptions: normalbalance :: HasReportOptsNoUpdate c_a47Pe => Lens' c_a47Pe (Maybe NormalSign)
+ Hledger.Reports.ReportOptions: normalbalance :: HasReportOptsNoUpdate c_a47Vq => Lens' c_a47Vq (Maybe NormalSign)
- Hledger.Reports.ReportOptions: percent :: HasReportOptsNoUpdate c_a47Pe => Lens' c_a47Pe Bool
+ Hledger.Reports.ReportOptions: percent :: HasReportOptsNoUpdate c_a47Vq => Lens' c_a47Vq Bool
- Hledger.Reports.ReportOptions: periodNoUpdate :: HasReportOptsNoUpdate c_a47Pe => Lens' c_a47Pe Period
+ Hledger.Reports.ReportOptions: periodNoUpdate :: HasReportOptsNoUpdate c_a47Vq => Lens' c_a47Vq Period
- Hledger.Reports.ReportOptions: pretty :: HasReportOptsNoUpdate c_a47Pe => Lens' c_a47Pe Bool
+ Hledger.Reports.ReportOptions: pretty :: HasReportOptsNoUpdate c_a47Vq => Lens' c_a47Vq Bool
- Hledger.Reports.ReportOptions: querystringNoUpdate :: HasReportOptsNoUpdate c_a47Pe => Lens' c_a47Pe [Text]
+ Hledger.Reports.ReportOptions: querystringNoUpdate :: HasReportOptsNoUpdate c_a47Vq => Lens' c_a47Vq [Text]
- Hledger.Reports.ReportOptions: realNoUpdate :: HasReportOptsNoUpdate c_a47Pe => Lens' c_a47Pe Bool
+ Hledger.Reports.ReportOptions: realNoUpdate :: HasReportOptsNoUpdate c_a47Vq => Lens' c_a47Vq Bool
- Hledger.Reports.ReportOptions: related :: HasReportOptsNoUpdate c_a47Pe => Lens' c_a47Pe Bool
+ Hledger.Reports.ReportOptions: related :: HasReportOptsNoUpdate c_a47Vq => Lens' c_a47Vq Bool
- Hledger.Reports.ReportOptions: reportOptsNoUpdate :: HasReportOptsNoUpdate c_a47Pe => Lens' c_a47Pe ReportOpts
+ Hledger.Reports.ReportOptions: reportOptsNoUpdate :: HasReportOptsNoUpdate c_a47Vq => Lens' c_a47Vq ReportOpts
- Hledger.Reports.ReportOptions: reportSpec :: HasReportSpec c_a48PW => Lens' c_a48PW ReportSpec
+ Hledger.Reports.ReportOptions: reportSpec :: HasReportSpec c_a48W8 => Lens' c_a48W8 ReportSpec
- Hledger.Reports.ReportOptions: row_total :: HasReportOptsNoUpdate c_a47Pe => Lens' c_a47Pe Bool
+ Hledger.Reports.ReportOptions: row_total :: HasReportOptsNoUpdate c_a47Vq => Lens' c_a47Vq Bool
- Hledger.Reports.ReportOptions: rsDay :: HasReportSpec c_a48PW => Lens' c_a48PW Day
+ Hledger.Reports.ReportOptions: rsDay :: HasReportSpec c_a48W8 => Lens' c_a48W8 Day
- Hledger.Reports.ReportOptions: rsQuery :: HasReportSpec c_a48PW => Lens' c_a48PW Query
+ Hledger.Reports.ReportOptions: rsQuery :: HasReportSpec c_a48W8 => Lens' c_a48W8 Query
- Hledger.Reports.ReportOptions: rsQueryOpts :: HasReportSpec c_a48PW => Lens' c_a48PW [QueryOpt]
+ Hledger.Reports.ReportOptions: rsQueryOpts :: HasReportSpec c_a48W8 => Lens' c_a48W8 [QueryOpt]
- Hledger.Reports.ReportOptions: rsReportOpts :: HasReportSpec c_a48PW => Lens' c_a48PW ReportOpts
+ Hledger.Reports.ReportOptions: rsReportOpts :: HasReportSpec c_a48W8 => Lens' c_a48W8 ReportOpts
- Hledger.Reports.ReportOptions: show_costs :: HasReportOptsNoUpdate c_a47Pe => Lens' c_a47Pe Bool
+ Hledger.Reports.ReportOptions: show_costs :: HasReportOptsNoUpdate c_a47Vq => Lens' c_a47Vq Bool
- Hledger.Reports.ReportOptions: sort_amount :: HasReportOptsNoUpdate c_a47Pe => Lens' c_a47Pe Bool
+ Hledger.Reports.ReportOptions: sort_amount :: HasReportOptsNoUpdate c_a47Vq => Lens' c_a47Vq Bool
- Hledger.Reports.ReportOptions: statusesNoUpdate :: HasReportOptsNoUpdate c_a47Pe => Lens' c_a47Pe [Status]
+ Hledger.Reports.ReportOptions: statusesNoUpdate :: HasReportOptsNoUpdate c_a47Vq => Lens' c_a47Vq [Status]
- Hledger.Reports.ReportOptions: summary_only :: HasReportOptsNoUpdate c_a47Pe => Lens' c_a47Pe Bool
+ Hledger.Reports.ReportOptions: summary_only :: HasReportOptsNoUpdate c_a47Vq => Lens' c_a47Vq Bool
- Hledger.Reports.ReportOptions: transpose__ :: HasReportOptsNoUpdate c_a47Pe => Lens' c_a47Pe Bool
+ Hledger.Reports.ReportOptions: transpose__ :: HasReportOptsNoUpdate c_a47Vq => Lens' c_a47Vq Bool
- Hledger.Reports.ReportOptions: txn_dates :: HasReportOptsNoUpdate c_a47Pe => Lens' c_a47Pe Bool
+ Hledger.Reports.ReportOptions: txn_dates :: HasReportOptsNoUpdate c_a47Vq => Lens' c_a47Vq Bool
- Hledger.Reports.ReportOptions: value :: HasReportOptsNoUpdate c_a47Pe => Lens' c_a47Pe (Maybe ValuationType)
+ Hledger.Reports.ReportOptions: value :: HasReportOptsNoUpdate c_a47Vq => Lens' c_a47Vq (Maybe ValuationType)
Files
- CHANGES.md +19/−1
- Hledger/Data/Amount.hs +47/−46
- Hledger/Data/Posting.hs +6/−6
- Hledger/Data/RawOptions.hs +7/−2
- Hledger/Data/Valuation.hs +6/−0
- Hledger/Read/RulesReader.hs +22/−11
- Hledger/Read/TimedotReader.hs +2/−2
- Hledger/Reports/BudgetReport.hs +7/−7
- Hledger/Utils/Debug.hs +6/−6
- Hledger/Utils/Parse.hs +11/−11
- hledger-lib.cabal +4/−4
CHANGES.md view
@@ -7,11 +7,29 @@ Breaking changes -Misc. changes+Fixes +Improvements+ --> Internal/api/developer-ish changes in the hledger-lib (and hledger) packages. For user-visible changes, see the hledger package changelog.++# 1.32.2 2023-12-31++Breaking changes++- In Hledger.Data.Amount, noPrice is renamed to noCost.++- AmountDisplayOpts has a new displayCommodity flag, controlling commodity symbol display.++Fixes++- Hledger.Utils.Debug.traceOrLog was logging when it should trace and vice versa.++Improvements++- Allow megaparsec 9.6 # 1.32.1 2023-12-07
Hledger/Data/Amount.hs view
@@ -80,7 +80,7 @@ -- ** rendering AmountDisplayOpts(..), noColour,- noPrice,+ noCost, oneLine, csvDisplay, showAmountB,@@ -174,7 +174,7 @@ import Data.List.NonEmpty (NonEmpty(..), nonEmpty) import qualified Data.Map.Strict as M import qualified Data.Set as S-import Data.Maybe (fromMaybe, isNothing, isJust)+import Data.Maybe (fromMaybe, isNothing) import Data.Semigroup (Semigroup(..)) import qualified Data.Text as T import qualified Data.Text.Lazy.Builder as TB@@ -219,18 +219,20 @@ -- | Options for the display of Amount and MixedAmount. -- (ee also Types.AmountStyle. data AmountDisplayOpts = AmountDisplayOpts- { displayPrice :: Bool -- ^ Whether to display the Price of an Amount.- , displayZeroCommodity :: Bool -- ^ If the Amount rounds to 0, whether to display its commodity string.- , displayThousandsSep :: Bool -- ^ Whether to display digit group marks (eg thousands separators)- , displayAddDecimalMark :: Bool -- ^ Whether to add a trailing decimal mark when there are no decimal digits - -- and there are digit group marks, to disambiguate- , displayColour :: Bool -- ^ Whether to colourise negative Amounts.- , displayOneLine :: Bool -- ^ Whether to display on one line.- , displayMinWidth :: Maybe Int -- ^ Minimum width to pad to- , displayMaxWidth :: Maybe Int -- ^ Maximum width to clip to- -- | Display amounts in this order (without the commodity symbol) and display- -- a 0 in case a corresponding commodity does not exist- , displayOrder :: Maybe [CommoditySymbol]+ { displayCommodity :: Bool -- ^ Whether to display commodity symbols.+ , displayZeroCommodity :: Bool -- ^ Whether to display commodity symbols for zero Amounts.+ , displayCommodityOrder :: Maybe [CommoditySymbol]+ -- ^ For a MixedAmount, an optional order in which to display the commodities.+ -- Also, causes 0s to be generated for any commodities which are not present+ -- (important for tabular reports).+ , displayDigitGroups :: Bool -- ^ Whether to display digit group marks (eg thousands separators)+ , displayForceDecimalMark :: Bool -- ^ Whether to add a trailing decimal mark when there are no decimal digits + -- and there are digit group marks, to disambiguate+ , displayOneLine :: Bool -- ^ Whether to display on one line.+ , displayMinWidth :: Maybe Int -- ^ Minimum width to pad to+ , displayMaxWidth :: Maybe Int -- ^ Maximum width to clip to+ , displayCost :: Bool -- ^ Whether to display Amounts' costs.+ , displayColour :: Bool -- ^ Whether to ansi-colourise negative Amounts. } deriving (Show) -- | By default, display Amount and MixedAmount using @noColour@ amount display options.@@ -238,28 +240,30 @@ -- | Display amounts without colour, and with various other defaults. noColour :: AmountDisplayOpts-noColour = AmountDisplayOpts { displayPrice = True- , displayColour = False- , displayZeroCommodity = False- , displayThousandsSep = True- , displayAddDecimalMark = False- , displayOneLine = False- , displayMinWidth = Just 0- , displayMaxWidth = Nothing- , displayOrder = Nothing- }+noColour = AmountDisplayOpts {+ displayCommodity = True+ , displayZeroCommodity = False+ , displayCommodityOrder = Nothing+ , displayDigitGroups = True+ , displayForceDecimalMark = False+ , displayOneLine = False+ , displayMinWidth = Just 0+ , displayMaxWidth = Nothing+ , displayCost = True+ , displayColour = False+ } -- | Display Amount and MixedAmount with no prices.-noPrice :: AmountDisplayOpts-noPrice = def{displayPrice=False}+noCost :: AmountDisplayOpts+noCost = def{displayCost=False} -- | Display Amount and MixedAmount on one line with no prices. oneLine :: AmountDisplayOpts-oneLine = def{displayOneLine=True, displayPrice=False}+oneLine = def{displayOneLine=True, displayCost=False} -- | Display Amount and MixedAmount in a form suitable for CSV output. csvDisplay :: AmountDisplayOpts-csvDisplay = oneLine{displayThousandsSep=False}+csvDisplay = oneLine{displayDigitGroups=False} ------------------------------------------------------------------------------- -- Amount arithmetic@@ -649,24 +653,21 @@ showAmountB :: AmountDisplayOpts -> Amount -> WideBuilder showAmountB _ Amount{acommodity="AUTO"} = mempty showAmountB- AmountDisplayOpts{displayPrice, displayColour, displayZeroCommodity, - displayThousandsSep, displayAddDecimalMark, displayOrder}+ AmountDisplayOpts{displayCommodity, displayZeroCommodity, displayDigitGroups+ ,displayForceDecimalMark, displayCost, displayColour} a@Amount{astyle=style} = color $ case ascommodityside style of- L -> showC (wbFromText comm) space <> quantity' <> price- R -> quantity' <> showC space (wbFromText comm) <> price+ L -> (if displayCommodity then wbFromText comm <> space else mempty) <> quantity' <> price+ R -> quantity' <> (if displayCommodity then space <> wbFromText comm else mempty) <> price where color = if displayColour && isNegativeAmount a then colorB Dull Red else id- quantity = showAmountQuantity displayAddDecimalMark $- if displayThousandsSep then a else a{astyle=(astyle a){asdigitgroups=Nothing}}+ quantity = showAmountQuantity displayForceDecimalMark $+ if displayDigitGroups then a else a{astyle=(astyle a){asdigitgroups=Nothing}} (quantity', comm) | 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- -- concatenate these texts,- -- or return the empty text if there's a commodity display order. XXX why ?- showC l r = if isJust displayOrder then mempty else l <> r- price = if displayPrice then showAmountPrice a else mempty+ price = if displayCost then showAmountPrice a else mempty -- | Colour version. For a negative amount, adds ANSI codes to change the colour, -- currently to hard-coded red.@@ -677,9 +678,9 @@ -- | Get the string representation of an amount, without any \@ price. ----- > showAmountWithoutPrice = wbUnpack . showAmountB noPrice+-- > showAmountWithoutPrice = wbUnpack . showAmountB noCost showAmountWithoutPrice :: Amount -> String-showAmountWithoutPrice = wbUnpack . showAmountB noPrice+showAmountWithoutPrice = wbUnpack . showAmountB noCost -- | Like showAmount, but show a zero amount's commodity if it has one. --@@ -1040,7 +1041,7 @@ -- -- > showMixedAmountOneLine = wbUnpack . showMixedAmountB oneLine showMixedAmountOneLine :: MixedAmount -> String-showMixedAmountOneLine = wbUnpack . showMixedAmountB oneLine{displayPrice=True}+showMixedAmountOneLine = wbUnpack . showMixedAmountB oneLine{displayCost=True} -- | Like showMixedAmount, but zero amounts are shown with their -- commodity if they have one.@@ -1052,9 +1053,9 @@ -- | Get the string representation of a mixed amount, without showing any transaction prices. -- With a True argument, adds ANSI codes to show negative amounts in red. ----- > showMixedAmountWithoutPrice c = wbUnpack . showMixedAmountB noPrice{displayColour=c}+-- > showMixedAmountWithoutPrice c = wbUnpack . showMixedAmountB noCost{displayColour=c} showMixedAmountWithoutPrice :: Bool -> MixedAmount -> String-showMixedAmountWithoutPrice c = wbUnpack . showMixedAmountB noPrice{displayColour=c}+showMixedAmountWithoutPrice c = wbUnpack . showMixedAmountB noCost{displayColour=c} -- | Get the one-line string representation of a mixed amount, but without -- any \@ prices.@@ -1107,7 +1108,7 @@ map (adBuilder . pad) elided where astrs = amtDisplayList (wbWidth sep) (showAmountB opts) . orderedAmounts opts $- if displayPrice opts then ma else mixedAmountStripPrices ma+ if displayCost opts then ma else mixedAmountStripPrices ma sep = WideBuilder (TB.singleton '\n') 0 width = maximum $ map (wbWidth . adBuilder) elided @@ -1133,7 +1134,7 @@ where width = maybe 0 adTotal $ lastMay elided astrs = amtDisplayList (wbWidth sep) (showAmountB opts) . orderedAmounts opts $- if displayPrice opts then ma else mixedAmountStripPrices ma+ if displayCost opts then ma else mixedAmountStripPrices ma sep = WideBuilder (TB.fromString ", ") 2 n = length astrs @@ -1159,7 +1160,7 @@ -- optionally preserving multiple zeros in different commodities, -- optionally sorting them according to a commodity display order. orderedAmounts :: AmountDisplayOpts -> MixedAmount -> [Amount]-orderedAmounts AmountDisplayOpts{displayZeroCommodity=preservezeros, displayOrder=mcommodityorder} =+orderedAmounts AmountDisplayOpts{displayZeroCommodity=preservezeros, displayCommodityOrder=mcommodityorder} = if preservezeros then amountsPreservingZeros else amounts <&> maybe id (mapM findfirst) mcommodityorder -- maybe sort them (somehow..) where
Hledger/Data/Posting.hs view
@@ -293,7 +293,7 @@ | elideamount = [mempty] | otherwise = showMixedAmountLinesB displayopts $ pamount p where displayopts = noColour{- displayZeroCommodity=True, displayAddDecimalMark=True, displayOneLine=onelineamounts+ displayZeroCommodity=True, displayForceDecimalMark=True, displayOneLine=onelineamounts } thisamtwidth = maximumBound 0 $ map wbWidth shownAmounts @@ -361,7 +361,7 @@ | elideamount = [mempty] | otherwise = showMixedAmountLinesB displayopts a' where- displayopts = noColour{ displayZeroCommodity=True, displayAddDecimalMark=True }+ displayopts = noColour{ displayZeroCommodity=True, displayForceDecimalMark=True } a' = mapMixedAmount amountToBeancount $ pamount p thisamtwidth = maximumBound 0 $ map wbWidth shownAmounts @@ -539,11 +539,11 @@ postingToCost :: ConversionOp -> Posting -> Maybe Posting postingToCost NoConversionOp p = Just p postingToCost ToCost p- -- If this is a conversion posting with a matched transaction price posting, ignore it- | "_conversion-matched" `elem` map fst (ptags p) && noCost = Nothing- | otherwise = Just $ postingTransformAmount mixedAmountCost p+ -- If this is a conversion posting with a matched transaction price posting, ignore it+ | "_conversion-matched" `elem` map fst (ptags p) && nocosts = Nothing+ | otherwise = Just $ postingTransformAmount mixedAmountCost p where- noCost = (not . any (isJust . aprice) . amountsRaw) $ pamount p+ nocosts = (not . any (isJust . aprice) . amountsRaw) $ pamount p -- | Generate inferred equity postings from a 'Posting' using transaction prices. -- Make sure not to generate equity postings when there are already matched
Hledger/Data/RawOptions.hs view
@@ -9,6 +9,8 @@ module Hledger.Data.RawOptions ( RawOpts,+ mkRawOpts,+ overRawOpts, setopt, setboolopt, unsetboolopt,@@ -24,8 +26,7 @@ posintopt, maybeintopt, maybeposintopt,- maybecharopt,- overRawOpts+ maybecharopt ) where @@ -42,6 +43,10 @@ instance Default RawOpts where def = RawOpts [] +mkRawOpts :: [(String,String)] -> RawOpts+mkRawOpts = RawOpts++overRawOpts :: ([(String,String)] -> [(String,String)]) -> RawOpts -> RawOpts overRawOpts f = RawOpts . f . unRawOpts setopt :: String -> String -> RawOpts -> RawOpts
Hledger/Data/Valuation.hs view
@@ -364,6 +364,12 @@ case concatMap extend paths of [] -> Nothing _ | pathlength > maxpathlength -> + -- XXX This is unusual:+ -- 1. A warning, not an error, which we usually avoid+ -- 2. Not a debug message (when triggered, we always print it)+ -- 3. Printed either to stdout or (eg in hledger-ui) to the debug log file.+ -- This is the only place we use traceOrLog like this.+ -- Also before 1.32.2, traceOrLog was doing the opposite of what it should [#2134]. traceOrLog ("gave up searching for a price chain at length "++show maxpathlength++", please report a bug") Nothing where
Hledger/Read/RulesReader.hs view
@@ -69,7 +69,7 @@ import qualified Data.ByteString.Lazy as BL import Data.Foldable (asum, toList) import Text.Megaparsec hiding (match, parse)-import Text.Megaparsec.Char (char, newline, string)+import Text.Megaparsec.Char (char, newline, string, digitChar) import Text.Megaparsec.Custom (parseErrorAt) import Text.Printf (printf) @@ -297,6 +297,9 @@ -- containing csv field references to be interpolated. type FieldTemplate = Text +-- | A reference to a regular expression match group. Eg \1.+type MatchGroupReference = Text+ -- | A strptime date parsing pattern, as supported by Data.Time.Format. type DateFormat = Text @@ -773,23 +776,31 @@ matcherPrefix (FieldMatcher prefix _ _) = prefix -- | Render a field assignment's template, possibly interpolating referenced--- CSV field values. Outer whitespace is removed from interpolated values.+-- CSV field values or match groups. Outer whitespace is removed from interpolated values. renderTemplate :: CsvRules -> CsvRecord -> HledgerFieldName -> FieldTemplate -> Text-renderTemplate rules record f t = maybe t mconcat $ parseMaybe- (many $ takeWhile1P Nothing isNotEscapeChar- <|> replaceRegexGroupReference rules record f <$> matchp- <|> replaceCsvFieldReference rules record <$> referencep)+renderTemplate rules record f t =+ maybe t mconcat $ parseMaybe+ (many+ ( literaltextp+ <|> (matchrefp <&> replaceRegexGroupReference rules record f)+ <|> (fieldrefp <&> replaceCsvFieldReference rules record)+ )+ ) t where- -- XXX: can we return a parsed Int here?- matchp = liftA2 T.cons (char '\\') (takeWhile1P (Just "matchref") isDigit) :: Parsec HledgerParseErrorData Text Text- referencep = liftA2 T.cons (char '%') (takeWhile1P (Just "reference") isFieldNameChar) :: Parsec HledgerParseErrorData Text Text+ literaltextp :: SimpleTextParser Text+ literaltextp = some (nonBackslashOrPercent <|> nonRefBackslash <|> nonRefPercent) <&> T.pack+ where+ nonBackslashOrPercent = noneOf ['\\', '%'] <?> "character other than backslash or percent"+ nonRefBackslash = try (char '\\' <* notFollowedBy digitChar) <?> "backslash that does not begin a match group reference"+ nonRefPercent = try (char '%' <* notFollowedBy (satisfy isFieldNameChar)) <?> "percent that does not begin a field reference"+ matchrefp = liftA2 T.cons (char '\\') (takeWhile1P (Just "matchref") isDigit)+ fieldrefp = liftA2 T.cons (char '%') (takeWhile1P (Just "reference") isFieldNameChar) isFieldNameChar c = isAlphaNum c || c == '_' || c == '-'- isNotEscapeChar c = c /='%' && c /= '\\' -- | Replace something that looks like a Regex match group reference with the -- resulting match group value after applying the Regex.-replaceRegexGroupReference :: CsvRules -> CsvRecord -> HledgerFieldName -> FieldTemplate -> Text+replaceRegexGroupReference :: CsvRules -> CsvRecord -> HledgerFieldName -> MatchGroupReference -> Text replaceRegexGroupReference rules record f s = case T.uncons s of Just ('\\', group) -> fromMaybe "" $ regexMatchValue rules record f group _ -> s
Hledger/Read/TimedotReader.hs view
@@ -209,8 +209,8 @@ -- (or empty string for none). durationsp :: TextParser m [(Hours,TagValue)] durationsp =- (dotquantityp <&> \h -> [(h,"")])- <|> (numericquantityp <&> \h -> [(h,"")])+ (try numericquantityp <&> \h -> [(h,"")]) -- try needed because numbers can begin with .+ <|> (dotquantityp <&> \h -> [(h,"")]) <|> letterquantitiesp <|> pure [(0,"")]
Hledger/Reports/BudgetReport.hs view
@@ -324,10 +324,10 @@ padcells = maybetranspose . fmap (fmap (uncurry paddisplaycell) . zip widths) . maybetranspose padtr = maybetranspose . fmap (fmap (uncurry paddisplaycell) . zip trwidths) . maybetranspose - -- commodities are shown with the amounts without `layout_ == LayoutBare`+ -- with --layout=bare, begin with a commodity column prependcs cs- | layout_ /= LayoutBare = id- | otherwise = zipWith (:) cs+ | layout_ == LayoutBare = zipWith (:) cs+ | otherwise = id rowToBudgetCells (PeriodicReportRow _ as rowtot rowavg) = as ++ [rowtot | row_total_ && not (null as)]@@ -337,9 +337,9 @@ rowfuncs :: [CommoditySymbol] -> (BudgetShowMixed, BudgetPercBudget) rowfuncs cs = case layout_ of LayoutWide width ->- ( pure . showMixedAmountB oneLine{displayColour=color_, displayMaxWidth=width}+ ( pure . showMixedAmountB oneLine{displayMaxWidth=width, displayColour=color_} , \a -> pure . percentage a)- _ -> ( showMixedAmountLinesB noPrice{displayOrder=Just cs, displayMinWidth=Nothing, displayColour=color_}+ _ -> ( showMixedAmountLinesB noCost{displayCommodity=layout_/=LayoutBare, displayCommodityOrder=Just cs, displayMinWidth=Nothing, displayColour=color_} , \a b -> fmap (percentage' a b) cs) showrow :: [BudgetCell] -> [(WideBuilder, BudgetDisplayRow)]@@ -476,11 +476,11 @@ | otherwise = joinNames . zipWith (:) cs -- add symbols and names . transpose -- each row becomes a list of Text quantities- . fmap (fmap wbToText . showMixedAmountLinesB oneLine{displayOrder=Just cs, displayMinWidth=Nothing}- .fromMaybe nullmixedamt)+ . fmap (fmap wbToText . showMixedAmountLinesB dopts . fromMaybe nullmixedamt) $ vals where cs = S.toList . foldl' S.union mempty . fmap maCommodities $ catMaybes vals+ dopts = oneLine{displayCommodity=layout_ /= LayoutBare, displayCommodityOrder=Just cs, displayMinWidth=Nothing} vals = flattentuples as ++ concat [[rowtot, budgettot] | row_total_] ++ concat [[rowavg, budgetavg] | average_]
Hledger/Utils/Debug.hs view
@@ -329,27 +329,27 @@ then return () else traceLogIO (labelledPretty False label a) --- Trace or log a string depending on shouldLog,+-- | Trace or log a string depending on shouldLog, -- before returning the second argument. traceOrLog :: String -> a -> a-traceOrLog = if shouldLog then trace else traceLog+traceOrLog = if shouldLog then traceLog else trace --- Trace or log a string depending on shouldLog,+-- | Trace or log a string depending on shouldLog, -- when global debug level is at or above the specified level, -- before returning the second argument. traceOrLogAt :: Int -> String -> a -> a traceOrLogAt = if shouldLog then traceLogAt else traceAt --- Pretty-trace or log depending on shouldLog, when global debug level+-- | Pretty-trace or log depending on shouldLog, when global debug level -- is at or above the specified level. ptraceOrLogAt :: Show a => Int -> String -> a -> a ptraceOrLogAt = if shouldLog then ptraceLogAt else ptraceAt --- Like ptraceOrLogAt, but convenient in IO.+-- | Like ptraceOrLogAt, but convenient in IO. ptraceOrLogAtIO :: (MonadIO m, Show a) => Int -> String -> a -> m () ptraceOrLogAtIO = if shouldLog then ptraceLogAtIO else ptraceAtIO --- Trace or log, with a show function, depending on shouldLog.+-- | Trace or log, with a show function, depending on shouldLog. traceOrLogAtWith :: Int -> (a -> String) -> a -> a traceOrLogAtWith = if shouldLog then traceLogAtWith else traceAtWith
Hledger/Utils/Parse.hs view
@@ -39,8 +39,8 @@ skipNonNewlineSpaces', -- ** Trace the state of hledger parsers- traceOrLogParse, dbgparse,+ traceOrLogParse, -- * re-exports HledgerParseErrors,@@ -72,7 +72,17 @@ -- | A parser of text that runs in some monad. type TextParser m a = ParsecT HledgerParseErrorData Text m a +-- class (Stream s, MonadPlus m) => MonadParsec e s m +-- dbgparse :: (MonadPlus m, MonadParsec e String m) => Int -> String -> m ()+ -- | Trace to stderr or log to debug log the provided label (if non-null)+-- and current parser state (position and next input),+-- if the global debug level is at or above the specified level.+-- Uses unsafePerformIO.+dbgparse :: Int -> String -> TextParser m ()+dbgparse level msg = when (level <= debugLevel) $ traceOrLogParse msg++-- | Trace to stderr or log to debug log the provided label (if non-null) -- and current parser state (position and next input). -- See also: Hledger.Utils.Debug, megaparsec's dbg. -- Uses unsafePerformIO.@@ -87,16 +97,6 @@ traceOrLog s' $ return () where peeklength = 30---- class (Stream s, MonadPlus m) => MonadParsec e s m --- dbgparse :: (MonadPlus m, MonadParsec e String m) => Int -> String -> m ()---- | Trace to stderr or log to debug log the provided label (if non-null)--- and current parser state (position and next input),--- if the global debug level is at or above the specified level.--- Uses unsafePerformIO.-dbgparse :: Int -> String -> TextParser m ()-dbgparse level msg = when (level <= debugLevel) $ traceOrLogParse msg -- | Render a pair of source positions in human-readable form, only displaying the range of lines. sourcePosPairPretty :: (SourcePos, SourcePos) -> String
hledger-lib.cabal view
@@ -5,7 +5,7 @@ -- see: https://github.com/sol/hpack name: hledger-lib-version: 1.32.1+version: 1.32.2 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@@ -131,7 +131,7 @@ , file-embed >=0.0.10 , filepath , hashtables >=1.2.3.1- , megaparsec >=7.0.0 && <9.6+ , megaparsec >=7.0.0 && <9.7 , microlens >=0.4 , microlens-th >=0.4 , mtl >=2.2.1@@ -190,7 +190,7 @@ , file-embed >=0.0.10 , filepath , hashtables >=1.2.3.1- , megaparsec >=7.0.0 && <9.6+ , megaparsec >=7.0.0 && <9.7 , microlens >=0.4 , microlens-th >=0.4 , mtl >=2.2.1@@ -251,7 +251,7 @@ , filepath , hashtables >=1.2.3.1 , hledger-lib- , megaparsec >=7.0.0 && <9.6+ , megaparsec >=7.0.0 && <9.7 , microlens >=0.4 , microlens-th >=0.4 , mtl >=2.2.1