From dff086a69d46086c7a1b97a74cc809265a6e0e32 Mon Sep 17 00:00:00 2001 From: Simon Michael Date: Wed, 8 Oct 2008 19:36:22 +0000 Subject: [PATCH] cleanups --- Ledger/Ledger.hs | 2 +- Ledger/Parse.hs | 2 +- Options.hs | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/Ledger/Ledger.hs b/Ledger/Ledger.hs index 7bc972b1c..385bd6a6e 100644 --- a/Ledger/Ledger.hs +++ b/Ledger/Ledger.hs @@ -104,7 +104,7 @@ filterLedgerEntriesByDate begin end (RawLedger ms ps es f) = -- | Remove entries which have no transactions. filterEmptyLedgerEntries :: RawLedger -> RawLedger filterEmptyLedgerEntries (RawLedger ms ps es f) = - RawLedger ms ps (filter ((> 0) . length . etransactions) es) f + RawLedger ms ps (filter (not . null . etransactions) es) f -- | In each ledger entry, filter out transactions which do not match the -- account pattern. Entries are no longer balanced after this. diff --git a/Ledger/Parse.hs b/Ledger/Parse.hs index 7fefe9527..667ee86b2 100644 --- a/Ledger/Parse.hs +++ b/Ledger/Parse.hs @@ -268,7 +268,7 @@ ledgeraccountname = do accountnamechar = alphaNum <|> oneOf ":/_" "account name character" singlespace = try (do {spacenonewline; do {notFollowedBy spacenonewline; return ' '}}) -- couldn't avoid consuming a final space sometimes, harmless - striptrailingspace s = if last s == ' ' then take (length s - 1) s else s + striptrailingspace s = if last s == ' ' then init s else s ledgeramount :: Parser Amount ledgeramount = diff --git a/Options.hs b/Options.hs index 2649670eb..981e676ee 100644 --- a/Options.hs +++ b/Options.hs @@ -107,7 +107,7 @@ endDateFromOpts opts = -- | Gather any ledger-style account/description pattern arguments into -- two lists. These are 0 or more account patterns optionally followed by --- 0 or more description patterns. +-- -- and 0 or more description patterns. parseAccountDescriptionArgs :: [String] -> ([String],[String]) parseAccountDescriptionArgs args = (as, ds') where (as, ds) = break (=="--") args