cacheLedger cleanup

This commit is contained in:
Simon Michael 2009-03-17 19:50:43 +00:00
parent fc928ba278
commit f7b2e62bcb

View File

@ -33,10 +33,9 @@ instance Show Ledger where
cacheLedger :: [String] -> RawLedger -> Ledger
cacheLedger apats l = Ledger{rawledgertext="",rawledger=l,accountnametree=ant,accountmap=acctmap}
where
(ant,txnsof,_,inclbalof) = groupTransactions $ filtertxns apats $ rawLedgerTransactions l
acctmap = Map.fromList [(a, mkacct a) | a <- flatten ant]
mkacct a = Account a (txnsof a) (inclbalof a)
ts = filtertxns apats $ rawLedgerTransactions l
(ant,txnsof,_,inclbalof) = groupTransactions ts
where mkacct a = Account a (txnsof a) (inclbalof a)
-- | Given a list of transactions, return an account name tree and three
-- query functions that fetch transactions, balance, and