From 5c687ab27588b19a2d0b0515869908524ed6cc3b Mon Sep 17 00:00:00 2001 From: "marko.kocic" Date: Tue, 22 Sep 2009 12:25:31 +0000 Subject: [PATCH] Hlint: Error: Use concatMap --- Ledger/AccountName.hs | 2 +- Ledger/RawLedger.hs | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/Ledger/AccountName.hs b/Ledger/AccountName.hs index b0cafa6ae..0d36436e5 100644 --- a/Ledger/AccountName.hs +++ b/Ledger/AccountName.hs @@ -33,7 +33,7 @@ accountNameLevel a = length (filter (==acctsepchar) a) + 1 -- | ["a:b:c","d:e"] -> ["a","a:b","a:b:c","d","d:e"] expandAccountNames :: [AccountName] -> [AccountName] -expandAccountNames as = nub $ concat $ map expand as +expandAccountNames as = nub $ concatMap expand as where expand = map accountNameFromComponents . tail . inits . accountNameComponents -- | ["a:b:c","d:e"] -> ["a","d"] diff --git a/Ledger/RawLedger.hs b/Ledger/RawLedger.hs index 3eb6f76ee..04db440a5 100644 --- a/Ledger/RawLedger.hs +++ b/Ledger/RawLedger.hs @@ -58,7 +58,7 @@ addTimeLogEntry tle l0 = l0 { open_timelog_entries = tle : open_timelog_entries rawLedgerTransactions :: RawLedger -> [Transaction] rawLedgerTransactions = txnsof . ledger_txns - where txnsof ts = concat $ map flattenLedgerTransaction $ zip ts [1..] + where txnsof ts = concatMap flattenLedgerTransaction $ zip ts [1..] rawLedgerAccountNamesUsed :: RawLedger -> [AccountName] rawLedgerAccountNamesUsed = accountNamesFromTransactions . rawLedgerTransactions