hledger-lib-0.11.1: Core types and utilities for working with hledger (or c++ ledger) data.



AccountNames are strings like assets:cash:petty, with multiple components separated by :. From a set of these we derive the account hierarchy.



subAccountNamesFrom :: [AccountName] -> AccountName -> [AccountName]Source

From a list of account names, select those which are direct subaccounts of the given account name.

accountNameTreeFrom :: [AccountName] -> Tree AccountNameSource

Convert a list of account names to a tree.

newtype Tree' a Source


T (Map a (Tree' a)) 


Eq a => Eq (Tree' a) 
Ord a => Ord (Tree' a) 
Show a => Show (Tree' a) 

mergeTrees :: Ord a => Tree' a -> Tree' a -> Tree' aSource

pathtree :: [a] -> Tree' aSource

fromPaths :: Ord a => [[a]] -> Tree' aSource

elideAccountName :: Int -> AccountName -> AccountNameSource


   start abbreviating the first parts of the account name down to two

Expenses:Cash           ; OK, not too long
     Ex:Wednesday:Cash       ; Expenses was abbreviated to fit
     Ex:We:Afternoon:Cash    ; Expenses and Wednesday abbreviated
     ; Expenses:Wednesday:Afternoon:Lunch:Snack:Candy:Chocolate:Cash
     ..:Af:Lu:Sn:Ca:Ch:Cash  ; Abbreviated and elided!