diff --git a/Account.hs b/Account.hs index 0bb35e39b..f7d878184 100644 --- a/Account.hs +++ b/Account.hs @@ -181,3 +181,5 @@ interestingAccountsFrom = hasbalance = (/= 0) . abalance hastxns = (> 0) . length . atransactions +ledgerAccountTree :: Ledger -> Tree Account +ledgerAccountTree l = addDataToAccountNameTree l (ledgerAccountNameTree l) diff --git a/Ledger.hs b/Ledger.hs index 9b99b8b2e..d7c2656ed 100644 --- a/Ledger.hs +++ b/Ledger.hs @@ -34,8 +34,8 @@ ledgerTransactionsMatching (acctregexps,descregexps) l = (concat [filter (matchTransactionDescription r) ts | r <- descregexps]) where ts = ledgerTransactions l -ledgerTransactionsInAccount :: Ledger -> AccountName -> [EntryTransaction] -ledgerTransactionsInAccount l a = ledgerTransactionsMatching (["^" ++ a ++ "$"], []) l +ledgerAccountTransactions :: Ledger -> AccountName -> [EntryTransaction] +ledgerAccountTransactions l a = ledgerTransactionsMatching (["^" ++ a ++ "$"], []) l accountNamesFromTransactions :: [EntryTransaction] -> [AccountName] accountNamesFromTransactions ts = nub $ map account ts diff --git a/Utils.hs b/Utils.hs index dc59d0c83..f638c666f 100644 --- a/Utils.hs +++ b/Utils.hs @@ -57,3 +57,4 @@ treeany f t = (f $ root t) || (any (treeany f) $ branches t) -- treedrop -- remove the leaves which do fulfill predicate. -- treedropall -- do this repeatedly. +strace a = trace (show a) a \ No newline at end of file diff --git a/hledger.hs b/hledger.hs index 750bc3336..39e6e2a4f 100644 --- a/hledger.hs +++ b/hledger.hs @@ -1,10 +1,10 @@ +#!/usr/bin/env runhaskell {- hledger - ledger-compatible money management tool (& haskell study) GPLv3, (c) Simon Michael & contributors A port of John Wiegley's ledger at http://newartisans.com/ledger.html -The module/model hierarchy is roughly like this; each layer can only -reference things below it: +Here is a rough overview of the module/model hierarchy: hledger Options