- cacheLedger :: [String] -> RawLedger -> Ledger
- groupTransactions :: [Transaction] -> (Tree AccountName, AccountName -> [Transaction], AccountName -> MixedAmount, AccountName -> MixedAmount)
- calculateBalances :: Tree AccountName -> (AccountName -> [Transaction]) -> Tree (AccountName, (MixedAmount, MixedAmount))
- transactionsByAccount :: [Transaction] -> Map AccountName [Transaction]
- filtertxns :: [String] -> [Transaction] -> [Transaction]
- accountnames :: Ledger -> [AccountName]
- ledgerAccount :: Ledger -> AccountName -> Account
- accounts :: Ledger -> [Account]
- topAccounts :: Ledger -> [Account]
- accountsMatching :: [String] -> Ledger -> [Account]
- subAccounts :: Ledger -> Account -> [Account]
- ledgerTransactions :: Ledger -> [Transaction]
- ledgerAccountTree :: Int -> Ledger -> Tree Account
- ledgerAccountTreeAt :: Ledger -> Account -> Maybe (Tree Account)
Convert a raw ledger to a more efficient cached type, described above.
Given a list of transactions, return an account name tree and three query functions that fetch transactions, balance, and subaccount-including balance by account name. This is to factor out common logic from cacheLedger and summariseTransactionsInDateSpan.
Add subaccount-excluding and subaccount-including balances to a tree of account names somewhat efficiently, given a function that looks up transactions by account name.
Convert a list of transactions to a map from account name to the list of all transactions in that account.
Accounts in ledger whose name matches the pattern, in tree order.
Get a ledger's tree of accounts to the specified depth.