misc support

This commit is contained in:
Simon Michael 2007-05-02 07:37:08 +00:00
parent bf89f7ac7a
commit 6bc4f5f72d
4 changed files with 7 additions and 4 deletions

View File

@ -181,3 +181,5 @@ interestingAccountsFrom =
hasbalance = (/= 0) . abalance
hastxns = (> 0) . length . atransactions
ledgerAccountTree :: Ledger -> Tree Account
ledgerAccountTree l = addDataToAccountNameTree l (ledgerAccountNameTree l)

View File

@ -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

View File

@ -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

View File

@ -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