packages feed

hledger-lib 1.24 → 1.24.1

raw patch · 5 files changed

+39/−12 lines, 5 filesPVP: major bump suggested

API removals or changes: PVP suggests a major version bump

API changes (from Hackage documentation)

+ Hledger.Query: filterQueryOrNotQuery :: (Query -> Bool) -> Query -> Query
- Hledger.Data.Balancing: balancingOpts :: HasBalancingOpts c_a2Yd1 => Lens' c_a2Yd1 BalancingOpts
+ Hledger.Data.Balancing: balancingOpts :: HasBalancingOpts c_a2Ylr => Lens' c_a2Ylr BalancingOpts
- Hledger.Data.Balancing: class HasBalancingOpts c_a2Yd1
+ Hledger.Data.Balancing: class HasBalancingOpts c_a2Ylr
- Hledger.Data.Balancing: commodity_styles :: HasBalancingOpts c_a2Yd1 => Lens' c_a2Yd1 (Maybe (Map CommoditySymbol AmountStyle))
+ Hledger.Data.Balancing: commodity_styles :: HasBalancingOpts c_a2Ylr => Lens' c_a2Ylr (Maybe (Map CommoditySymbol AmountStyle))
- Hledger.Data.Balancing: ignore_assertions :: HasBalancingOpts c_a2Yd1 => Lens' c_a2Yd1 Bool
+ Hledger.Data.Balancing: ignore_assertions :: HasBalancingOpts c_a2Ylr => Lens' c_a2Ylr Bool
- Hledger.Data.Balancing: infer_transaction_prices :: HasBalancingOpts c_a2Yd1 => Lens' c_a2Yd1 Bool
+ Hledger.Data.Balancing: infer_transaction_prices :: HasBalancingOpts c_a2Ylr => Lens' c_a2Ylr Bool
- Hledger.Read.Common: aliases :: HasInputOpts c_a3bqc => Lens' c_a3bqc [String]
+ Hledger.Read.Common: aliases :: HasInputOpts c_a3byC => Lens' c_a3byC [String]
- Hledger.Read.Common: anon__ :: HasInputOpts c_a3bqc => Lens' c_a3bqc Bool
+ Hledger.Read.Common: anon__ :: HasInputOpts c_a3byC => Lens' c_a3byC Bool
- Hledger.Read.Common: auto__ :: HasInputOpts c_a3bqc => Lens' c_a3bqc Bool
+ Hledger.Read.Common: auto__ :: HasInputOpts c_a3byC => Lens' c_a3byC Bool
- Hledger.Read.Common: balancingopts :: HasInputOpts c_a3bqc => Lens' c_a3bqc BalancingOpts
+ Hledger.Read.Common: balancingopts :: HasInputOpts c_a3byC => Lens' c_a3byC BalancingOpts
- Hledger.Read.Common: class HasInputOpts c_a3bqc
+ Hledger.Read.Common: class HasInputOpts c_a3byC
- Hledger.Read.Common: forecast :: HasInputOpts c_a3bqc => Lens' c_a3bqc (Maybe DateSpan)
+ Hledger.Read.Common: forecast :: HasInputOpts c_a3byC => Lens' c_a3byC (Maybe DateSpan)
- Hledger.Read.Common: inputOpts :: HasInputOpts c_a3bqc => Lens' c_a3bqc InputOpts
+ Hledger.Read.Common: inputOpts :: HasInputOpts c_a3byC => Lens' c_a3byC InputOpts
- Hledger.Read.Common: ioDay :: HasInputOpts c_a3bqc => Lens' c_a3bqc Day
+ Hledger.Read.Common: ioDay :: HasInputOpts c_a3byC => Lens' c_a3byC Day
- Hledger.Read.Common: mformat :: HasInputOpts c_a3bqc => Lens' c_a3bqc (Maybe StorageFormat)
+ Hledger.Read.Common: mformat :: HasInputOpts c_a3byC => Lens' c_a3byC (Maybe StorageFormat)
- Hledger.Read.Common: mrules_file :: HasInputOpts c_a3bqc => Lens' c_a3bqc (Maybe FilePath)
+ Hledger.Read.Common: mrules_file :: HasInputOpts c_a3byC => Lens' c_a3byC (Maybe FilePath)
- Hledger.Read.Common: new__ :: HasInputOpts c_a3bqc => Lens' c_a3bqc Bool
+ Hledger.Read.Common: new__ :: HasInputOpts c_a3byC => Lens' c_a3byC Bool
- Hledger.Read.Common: new_save :: HasInputOpts c_a3bqc => Lens' c_a3bqc Bool
+ Hledger.Read.Common: new_save :: HasInputOpts c_a3byC => Lens' c_a3byC Bool
- Hledger.Read.Common: pivot :: HasInputOpts c_a3bqc => Lens' c_a3bqc String
+ Hledger.Read.Common: pivot :: HasInputOpts c_a3byC => Lens' c_a3byC String
- Hledger.Read.Common: reportspan :: HasInputOpts c_a3bqc => Lens' c_a3bqc DateSpan
+ Hledger.Read.Common: reportspan :: HasInputOpts c_a3byC => Lens' c_a3byC DateSpan
- Hledger.Read.Common: strict :: HasInputOpts c_a3bqc => Lens' c_a3bqc Bool
+ Hledger.Read.Common: strict :: HasInputOpts c_a3byC => Lens' c_a3byC Bool
- Hledger.Read.InputOptions: aliases :: HasInputOpts c_a3bqc => Lens' c_a3bqc [String]
+ Hledger.Read.InputOptions: aliases :: HasInputOpts c_a3byC => Lens' c_a3byC [String]
- Hledger.Read.InputOptions: anon__ :: HasInputOpts c_a3bqc => Lens' c_a3bqc Bool
+ Hledger.Read.InputOptions: anon__ :: HasInputOpts c_a3byC => Lens' c_a3byC Bool
- Hledger.Read.InputOptions: auto__ :: HasInputOpts c_a3bqc => Lens' c_a3bqc Bool
+ Hledger.Read.InputOptions: auto__ :: HasInputOpts c_a3byC => Lens' c_a3byC Bool
- Hledger.Read.InputOptions: balancingopts :: HasInputOpts c_a3bqc => Lens' c_a3bqc BalancingOpts
+ Hledger.Read.InputOptions: balancingopts :: HasInputOpts c_a3byC => Lens' c_a3byC BalancingOpts
- Hledger.Read.InputOptions: class HasInputOpts c_a3bqc
+ Hledger.Read.InputOptions: class HasInputOpts c_a3byC
- Hledger.Read.InputOptions: forecast :: HasInputOpts c_a3bqc => Lens' c_a3bqc (Maybe DateSpan)
+ Hledger.Read.InputOptions: forecast :: HasInputOpts c_a3byC => Lens' c_a3byC (Maybe DateSpan)
- Hledger.Read.InputOptions: inputOpts :: HasInputOpts c_a3bqc => Lens' c_a3bqc InputOpts
+ Hledger.Read.InputOptions: inputOpts :: HasInputOpts c_a3byC => Lens' c_a3byC InputOpts
- Hledger.Read.InputOptions: ioDay :: HasInputOpts c_a3bqc => Lens' c_a3bqc Day
+ Hledger.Read.InputOptions: ioDay :: HasInputOpts c_a3byC => Lens' c_a3byC Day
- Hledger.Read.InputOptions: mformat :: HasInputOpts c_a3bqc => Lens' c_a3bqc (Maybe StorageFormat)
+ Hledger.Read.InputOptions: mformat :: HasInputOpts c_a3byC => Lens' c_a3byC (Maybe StorageFormat)
- Hledger.Read.InputOptions: mrules_file :: HasInputOpts c_a3bqc => Lens' c_a3bqc (Maybe FilePath)
+ Hledger.Read.InputOptions: mrules_file :: HasInputOpts c_a3byC => Lens' c_a3byC (Maybe FilePath)
- Hledger.Read.InputOptions: new__ :: HasInputOpts c_a3bqc => Lens' c_a3bqc Bool
+ Hledger.Read.InputOptions: new__ :: HasInputOpts c_a3byC => Lens' c_a3byC Bool
- Hledger.Read.InputOptions: new_save :: HasInputOpts c_a3bqc => Lens' c_a3bqc Bool
+ Hledger.Read.InputOptions: new_save :: HasInputOpts c_a3byC => Lens' c_a3byC Bool
- Hledger.Read.InputOptions: pivot :: HasInputOpts c_a3bqc => Lens' c_a3bqc String
+ Hledger.Read.InputOptions: pivot :: HasInputOpts c_a3byC => Lens' c_a3byC String
- Hledger.Read.InputOptions: reportspan :: HasInputOpts c_a3bqc => Lens' c_a3bqc DateSpan
+ Hledger.Read.InputOptions: reportspan :: HasInputOpts c_a3byC => Lens' c_a3byC DateSpan
- Hledger.Read.InputOptions: strict :: HasInputOpts c_a3bqc => Lens' c_a3bqc Bool
+ Hledger.Read.InputOptions: strict :: HasInputOpts c_a3byC => Lens' c_a3byC Bool
- Hledger.Reports.ReportOptions: accountlistmode :: HasReportOptsNoUpdate c_a3iyF => Lens' c_a3iyF AccountListMode
+ Hledger.Reports.ReportOptions: accountlistmode :: HasReportOptsNoUpdate c_a3iH5 => Lens' c_a3iH5 AccountListMode
- Hledger.Reports.ReportOptions: average :: HasReportOptsNoUpdate c_a3iyF => Lens' c_a3iyF Bool
+ Hledger.Reports.ReportOptions: average :: HasReportOptsNoUpdate c_a3iH5 => Lens' c_a3iH5 Bool
- Hledger.Reports.ReportOptions: balanceaccum :: HasReportOptsNoUpdate c_a3iyF => Lens' c_a3iyF BalanceAccumulation
+ Hledger.Reports.ReportOptions: balanceaccum :: HasReportOptsNoUpdate c_a3iH5 => Lens' c_a3iH5 BalanceAccumulation
- Hledger.Reports.ReportOptions: balancecalc :: HasReportOptsNoUpdate c_a3iyF => Lens' c_a3iyF BalanceCalculation
+ Hledger.Reports.ReportOptions: balancecalc :: HasReportOptsNoUpdate c_a3iH5 => Lens' c_a3iH5 BalanceCalculation
- Hledger.Reports.ReportOptions: budgetpat :: HasReportOptsNoUpdate c_a3iyF => Lens' c_a3iyF (Maybe Text)
+ Hledger.Reports.ReportOptions: budgetpat :: HasReportOptsNoUpdate c_a3iH5 => Lens' c_a3iH5 (Maybe Text)
- Hledger.Reports.ReportOptions: class HasReportOptsNoUpdate c_a3iyF
+ Hledger.Reports.ReportOptions: class HasReportOptsNoUpdate c_a3iH5
- Hledger.Reports.ReportOptions: class HasReportSpec c_a3jg2
+ Hledger.Reports.ReportOptions: class HasReportSpec c_a3jos
- Hledger.Reports.ReportOptions: color__ :: HasReportOptsNoUpdate c_a3iyF => Lens' c_a3iyF Bool
+ Hledger.Reports.ReportOptions: color__ :: HasReportOptsNoUpdate c_a3iH5 => Lens' c_a3iH5 Bool
- Hledger.Reports.ReportOptions: commodity_layout :: HasReportOptsNoUpdate c_a3iyF => Lens' c_a3iyF CommodityLayout
+ Hledger.Reports.ReportOptions: commodity_layout :: HasReportOptsNoUpdate c_a3iH5 => Lens' c_a3iH5 CommodityLayout
- Hledger.Reports.ReportOptions: cost :: HasReportOptsNoUpdate c_a3iyF => Lens' c_a3iyF Costing
+ Hledger.Reports.ReportOptions: cost :: HasReportOptsNoUpdate c_a3iH5 => Lens' c_a3iH5 Costing
- Hledger.Reports.ReportOptions: date2NoUpdate :: HasReportOptsNoUpdate c_a3iyF => Lens' c_a3iyF Bool
+ Hledger.Reports.ReportOptions: date2NoUpdate :: HasReportOptsNoUpdate c_a3iH5 => Lens' c_a3iH5 Bool
- Hledger.Reports.ReportOptions: declared :: HasReportOptsNoUpdate c_a3iyF => Lens' c_a3iyF Bool
+ Hledger.Reports.ReportOptions: declared :: HasReportOptsNoUpdate c_a3iH5 => Lens' c_a3iH5 Bool
- Hledger.Reports.ReportOptions: depthNoUpdate :: HasReportOptsNoUpdate c_a3iyF => Lens' c_a3iyF (Maybe Int)
+ Hledger.Reports.ReportOptions: depthNoUpdate :: HasReportOptsNoUpdate c_a3iH5 => Lens' c_a3iH5 (Maybe Int)
- Hledger.Reports.ReportOptions: drop__ :: HasReportOptsNoUpdate c_a3iyF => Lens' c_a3iyF Int
+ Hledger.Reports.ReportOptions: drop__ :: HasReportOptsNoUpdate c_a3iH5 => Lens' c_a3iH5 Int
- Hledger.Reports.ReportOptions: empty__ :: HasReportOptsNoUpdate c_a3iyF => Lens' c_a3iyF Bool
+ Hledger.Reports.ReportOptions: empty__ :: HasReportOptsNoUpdate c_a3iH5 => Lens' c_a3iH5 Bool
- Hledger.Reports.ReportOptions: format :: HasReportOptsNoUpdate c_a3iyF => Lens' c_a3iyF StringFormat
+ Hledger.Reports.ReportOptions: format :: HasReportOptsNoUpdate c_a3iH5 => Lens' c_a3iH5 StringFormat
- Hledger.Reports.ReportOptions: infer_prices :: HasReportOptsNoUpdate c_a3iyF => Lens' c_a3iyF Bool
+ Hledger.Reports.ReportOptions: infer_prices :: HasReportOptsNoUpdate c_a3iH5 => Lens' c_a3iH5 Bool
- Hledger.Reports.ReportOptions: interval :: HasReportOptsNoUpdate c_a3iyF => Lens' c_a3iyF Interval
+ Hledger.Reports.ReportOptions: interval :: HasReportOptsNoUpdate c_a3iH5 => Lens' c_a3iH5 Interval
- Hledger.Reports.ReportOptions: invert :: HasReportOptsNoUpdate c_a3iyF => Lens' c_a3iyF Bool
+ Hledger.Reports.ReportOptions: invert :: HasReportOptsNoUpdate c_a3iH5 => Lens' c_a3iH5 Bool
- Hledger.Reports.ReportOptions: no_elide :: HasReportOptsNoUpdate c_a3iyF => Lens' c_a3iyF Bool
+ Hledger.Reports.ReportOptions: no_elide :: HasReportOptsNoUpdate c_a3iH5 => Lens' c_a3iH5 Bool
- Hledger.Reports.ReportOptions: no_total :: HasReportOptsNoUpdate c_a3iyF => Lens' c_a3iyF Bool
+ Hledger.Reports.ReportOptions: no_total :: HasReportOptsNoUpdate c_a3iH5 => Lens' c_a3iH5 Bool
- Hledger.Reports.ReportOptions: normalbalance :: HasReportOptsNoUpdate c_a3iyF => Lens' c_a3iyF (Maybe NormalSign)
+ Hledger.Reports.ReportOptions: normalbalance :: HasReportOptsNoUpdate c_a3iH5 => Lens' c_a3iH5 (Maybe NormalSign)
- Hledger.Reports.ReportOptions: percent :: HasReportOptsNoUpdate c_a3iyF => Lens' c_a3iyF Bool
+ Hledger.Reports.ReportOptions: percent :: HasReportOptsNoUpdate c_a3iH5 => Lens' c_a3iH5 Bool
- Hledger.Reports.ReportOptions: periodNoUpdate :: HasReportOptsNoUpdate c_a3iyF => Lens' c_a3iyF Period
+ Hledger.Reports.ReportOptions: periodNoUpdate :: HasReportOptsNoUpdate c_a3iH5 => Lens' c_a3iH5 Period
- Hledger.Reports.ReportOptions: pretty :: HasReportOptsNoUpdate c_a3iyF => Lens' c_a3iyF Bool
+ Hledger.Reports.ReportOptions: pretty :: HasReportOptsNoUpdate c_a3iH5 => Lens' c_a3iH5 Bool
- Hledger.Reports.ReportOptions: querystringNoUpdate :: HasReportOptsNoUpdate c_a3iyF => Lens' c_a3iyF [Text]
+ Hledger.Reports.ReportOptions: querystringNoUpdate :: HasReportOptsNoUpdate c_a3iH5 => Lens' c_a3iH5 [Text]
- Hledger.Reports.ReportOptions: realNoUpdate :: HasReportOptsNoUpdate c_a3iyF => Lens' c_a3iyF Bool
+ Hledger.Reports.ReportOptions: realNoUpdate :: HasReportOptsNoUpdate c_a3iH5 => Lens' c_a3iH5 Bool
- Hledger.Reports.ReportOptions: related :: HasReportOptsNoUpdate c_a3iyF => Lens' c_a3iyF Bool
+ Hledger.Reports.ReportOptions: related :: HasReportOptsNoUpdate c_a3iH5 => Lens' c_a3iH5 Bool
- Hledger.Reports.ReportOptions: reportOptsNoUpdate :: HasReportOptsNoUpdate c_a3iyF => Lens' c_a3iyF ReportOpts
+ Hledger.Reports.ReportOptions: reportOptsNoUpdate :: HasReportOptsNoUpdate c_a3iH5 => Lens' c_a3iH5 ReportOpts
- Hledger.Reports.ReportOptions: reportSpec :: HasReportSpec c_a3jg2 => Lens' c_a3jg2 ReportSpec
+ Hledger.Reports.ReportOptions: reportSpec :: HasReportSpec c_a3jos => Lens' c_a3jos ReportSpec
- Hledger.Reports.ReportOptions: row_total :: HasReportOptsNoUpdate c_a3iyF => Lens' c_a3iyF Bool
+ Hledger.Reports.ReportOptions: row_total :: HasReportOptsNoUpdate c_a3iH5 => Lens' c_a3iH5 Bool
- Hledger.Reports.ReportOptions: rsDay :: HasReportSpec c_a3jg2 => Lens' c_a3jg2 Day
+ Hledger.Reports.ReportOptions: rsDay :: HasReportSpec c_a3jos => Lens' c_a3jos Day
- Hledger.Reports.ReportOptions: rsQuery :: HasReportSpec c_a3jg2 => Lens' c_a3jg2 Query
+ Hledger.Reports.ReportOptions: rsQuery :: HasReportSpec c_a3jos => Lens' c_a3jos Query
- Hledger.Reports.ReportOptions: rsQueryOpts :: HasReportSpec c_a3jg2 => Lens' c_a3jg2 [QueryOpt]
+ Hledger.Reports.ReportOptions: rsQueryOpts :: HasReportSpec c_a3jos => Lens' c_a3jos [QueryOpt]
- Hledger.Reports.ReportOptions: rsReportOpts :: HasReportSpec c_a3jg2 => Lens' c_a3jg2 ReportOpts
+ Hledger.Reports.ReportOptions: rsReportOpts :: HasReportSpec c_a3jos => Lens' c_a3jos ReportOpts
- Hledger.Reports.ReportOptions: show_costs :: HasReportOptsNoUpdate c_a3iyF => Lens' c_a3iyF Bool
+ Hledger.Reports.ReportOptions: show_costs :: HasReportOptsNoUpdate c_a3iH5 => Lens' c_a3iH5 Bool
- Hledger.Reports.ReportOptions: sort_amount :: HasReportOptsNoUpdate c_a3iyF => Lens' c_a3iyF Bool
+ Hledger.Reports.ReportOptions: sort_amount :: HasReportOptsNoUpdate c_a3iH5 => Lens' c_a3iH5 Bool
- Hledger.Reports.ReportOptions: statusesNoUpdate :: HasReportOptsNoUpdate c_a3iyF => Lens' c_a3iyF [Status]
+ Hledger.Reports.ReportOptions: statusesNoUpdate :: HasReportOptsNoUpdate c_a3iH5 => Lens' c_a3iH5 [Status]
- Hledger.Reports.ReportOptions: transpose__ :: HasReportOptsNoUpdate c_a3iyF => Lens' c_a3iyF Bool
+ Hledger.Reports.ReportOptions: transpose__ :: HasReportOptsNoUpdate c_a3iH5 => Lens' c_a3iH5 Bool
- Hledger.Reports.ReportOptions: txn_dates :: HasReportOptsNoUpdate c_a3iyF => Lens' c_a3iyF Bool
+ Hledger.Reports.ReportOptions: txn_dates :: HasReportOptsNoUpdate c_a3iH5 => Lens' c_a3iH5 Bool
- Hledger.Reports.ReportOptions: value :: HasReportOptsNoUpdate c_a3iyF => Lens' c_a3iyF (Maybe ValuationType)
+ Hledger.Reports.ReportOptions: value :: HasReportOptsNoUpdate c_a3iH5 => Lens' c_a3iH5 (Maybe ValuationType)
- Hledger.Utils: treeLeaves :: Tree a -> [a]
+ Hledger.Utils: treeLeaves :: Show a => Tree a -> [a]

Files

CHANGES.md view
@@ -9,6 +9,12 @@ Internal/api/developer-ish changes in the hledger-lib (and hledger) packages. For user-visible changes, see the hledger package changelog. +# 1.24.1 2021-12-10++Improvements++- Added: filterQueryOrNotQuery.+ # 1.24 2021-12-01  Improvements
Hledger/Query.hs view
@@ -23,6 +23,7 @@   parseQueryTerm,   simplifyQuery,   filterQuery,+  filterQueryOrNotQuery,   -- * accessors   queryIsNull,   queryIsAcct,@@ -378,16 +379,30 @@ same [] = True same (a:as) = all (a==) as --- | Remove query terms (or whole sub-expressions) not matching the given--- predicate from this query.  XXX Semantics not completely clear.+-- | Remove query terms (or whole sub-expressions) from this query+-- which do not match the given predicate.+-- XXX Semantics not completely clear. filterQuery :: (Query -> Bool) -> Query -> Query filterQuery p = simplifyQuery . filterQuery' p+  where+    filterQuery' :: (Query -> Bool) -> Query -> Query+    filterQuery' p (And qs) = And $ map (filterQuery p) qs+    filterQuery' p (Or qs) = Or $ map (filterQuery p) qs+    filterQuery' p q = if p q then q else Any -filterQuery' :: (Query -> Bool) -> Query -> Query-filterQuery' p (And qs) = And $ map (filterQuery p) qs-filterQuery' p (Or qs) = Or $ map (filterQuery p) qs--- filterQuery' p (Not q) = Not $ filterQuery p q-filterQuery' p q = if p q then q else Any+-- | Remove query terms (or whole sub-expressions) from this query+-- which match neither the given predicate nor that predicate negated +-- (eg, if predicate is queryIsAcct, this will keep both "acct:" and "not:acct:" terms).+-- (Since 1.24.1, might be merged into filterQuery in future.)+-- XXX Semantics not completely clear.+filterQueryOrNotQuery :: (Query -> Bool) -> Query -> Query+filterQueryOrNotQuery p = simplifyQuery . filterQuery' p+  where+    filterQuery' :: (Query -> Bool) -> Query -> Query+    filterQuery' p (And qs)      = And $ map (filterQueryOrNotQuery p) qs+    filterQuery' p (Or qs)       = Or  $ map (filterQueryOrNotQuery p) qs+    filterQuery' p (Not q) | p q = Not $ filterQueryOrNotQuery p q+    filterQuery' p q = if p q then q else Any  -- * accessors @@ -398,6 +413,9 @@ queryIsNull (Not (Or [])) = True queryIsNull _ = False +-- | Is this a simple query of this type ("depth:D") ? +-- Note, does not match a compound query like "not:depth:D" or "depth:D acct:A".+-- Likewise for the following functions. queryIsDepth :: Query -> Bool queryIsDepth (Depth _) = True queryIsDepth _ = False
Hledger/Reports/MultiBalanceReport.hs view
@@ -285,7 +285,7 @@         declaredacctps =            [nullposting{paccount=n} | n <- journalLeafAccountNamesDeclared j                                    , acctq `matchesAccount` n]-          where acctq  = dbg3 "acctq" $ filterQuery queryIsAcct query+          where acctq  = dbg3 "acctq" $ filterQueryOrNotQuery queryIsAcct query      filterbydepth = case accountlistmode_ of       ALTree -> filter ((depthq `matchesAccount`) . aname)    -- a tree - just exclude deeper accounts
Hledger/Utils.hs view
@@ -59,7 +59,7 @@ import Hledger.Utils.String import Hledger.Utils.Text import Hledger.Utils.Test-import Data.Tree (foldTree, Tree)+import Data.Tree (foldTree, Tree (Node, subForest))   -- tuples@@ -120,8 +120,11 @@  -- trees -treeLeaves :: Tree a -> [a]-treeLeaves = foldTree (\a bs -> (if null bs then (a:) else id) $ concat bs)+-- | Get the leaves of this tree as a list. +-- The topmost node ("root" in hledger account trees) is not counted as a leaf.+treeLeaves :: Show a => Tree a -> [a]+treeLeaves Node{subForest=[]} = []+treeLeaves t = foldTree (\a bs -> (if null bs then (a:) else id) $ concat bs) t  -- text 
hledger-lib.cabal view
@@ -5,7 +5,7 @@ -- see: https://github.com/sol/hpack  name:           hledger-lib-version:        1.24+version:        1.24.1 synopsis:       A reusable library providing the core functionality of hledger description:    A reusable library containing hledger's core functionality.                 This is used by most hledger* packages so that they support the same