diff --git a/hledger/Hledger/Cli/Stats.hs b/hledger/Hledger/Cli/Stats.hs index 5258acb95..e50238774 100644 --- a/hledger/Hledger/Cli/Stats.hs +++ b/hledger/Hledger/Cli/Stats.hs @@ -13,6 +13,8 @@ where import Data.List import Data.Maybe import Data.Ord +import Data.HashSet (size, fromList) +import Data.Text (pack) import Data.Time.Calendar import System.Console.CmdArgs.Explicit import Text.Printf @@ -63,7 +65,7 @@ showLedgerStats l today span = ,("Transactions", printf "%d (%0.1f per day)" tnum txnrate) ,("Transactions last 30 days", printf "%d (%0.1f per day)" tnum30 txnrate30) ,("Transactions last 7 days", printf "%d (%0.1f per day)" tnum7 txnrate7) - ,("Payees/descriptions", show $ length $ nub $ map tdescription ts) + ,("Payees/descriptions", show $ size $ fromList $ map (pack . tdescription) ts) ,("Accounts", printf "%d (depth %d)" acctnum acctdepth) ,("Commodities", printf "%s (%s)" (show $ length cs) (intercalate ", " cs)) -- Transactions this month : %(monthtxns)s (last month in the same period: %(lastmonthtxns)s) diff --git a/hledger/hledger.cabal b/hledger/hledger.cabal index 029c982ef..0f3d6664b 100644 --- a/hledger/hledger.cabal +++ b/hledger/hledger.cabal @@ -74,6 +74,7 @@ library ,base-compat >= 0.8.1 -- ,cabal-file-th ,containers + ,unordered-containers ,cmdargs >= 0.10 && < 0.11 ,csv -- ,data-pprint >= 0.2.1 && < 0.3 @@ -128,6 +129,7 @@ executable hledger ,base >= 4.3 && < 5 ,base-compat >= 0.8.1 ,containers + ,unordered-containers ,cmdargs >= 0.10 && < 0.11 ,csv -- ,data-pprint >= 0.2.1 && < 0.3