hledger-0.8: A command-line (or curses or web-based) double-entry accounting tool.Source codeContentsIndex
Ledger.AccountName
Description
AccountNames are strings like assets:cash:petty. From a set of these we derive the account hierarchy.
Synopsis
accountNameComponents :: AccountName -> [String]
accountNameFromComponents :: [String] -> AccountName
accountLeafName :: AccountName -> String
accountNameLevel :: AccountName -> Int
expandAccountNames :: [AccountName] -> [AccountName]
topAccountNames :: [AccountName] -> [AccountName]
parentAccountName :: AccountName -> AccountName
parentAccountNames :: AccountName -> [AccountName]
isAccountNamePrefixOf :: AccountName -> AccountName -> Bool
isSubAccountNameOf :: AccountName -> AccountName -> Bool
subAccountNamesFrom :: [AccountName] -> AccountName -> [AccountName]
accountNameTreeFrom :: [AccountName] -> Tree AccountName
newtype Tree' a = T (Map a (Tree' a))
mergeTrees :: Ord a => Tree' a -> Tree' a -> Tree' a
pathtree :: [a] -> Tree' a
fromPaths :: Ord a => [[a]] -> Tree' a
converttree :: Tree' AccountName -> [Tree AccountName]
expandTreeNames :: Tree AccountName -> Tree AccountName
accountNameTreeFrom4 :: [AccountName] -> Tree AccountName
elideAccountName :: Int -> AccountName -> AccountName
clipAccountName :: Int -> AccountName -> AccountName
Documentation
accountNameComponents :: AccountName -> [String]Source
accountNameFromComponents :: [String] -> AccountNameSource
accountLeafName :: AccountName -> StringSource
accountNameLevel :: AccountName -> IntSource
expandAccountNames :: [AccountName] -> [AccountName]Source
a:b:c,d:e
-> [a,a:b,a:b:c,d,d:e]
topAccountNames :: [AccountName] -> [AccountName]Source
a:b:c,d:e
-> [a,d]
parentAccountName :: AccountName -> AccountNameSource
parentAccountNames :: AccountName -> [AccountName]Source
isAccountNamePrefixOf :: AccountName -> AccountName -> BoolSource
isSubAccountNameOf :: AccountName -> AccountName -> BoolSource
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
Constructors
T (Map a (Tree' a))
show/hide Instances
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
converttree :: Tree' AccountName -> [Tree AccountName]Source
expandTreeNames :: Tree AccountName -> Tree AccountNameSource
accountNameTreeFrom4 :: [AccountName] -> Tree AccountNameSource
elideAccountName :: Int -> AccountName -> AccountNameSource

Elide an account name to fit in the specified width. From the ledger 2.6 news:

   What Ledger now does is that if an account name is too long, it will
   start abbreviating the first parts of the account name down to two
   letters in length.  If this results in a string that is still too
   long, the front will be elided -- not the end.  For example:

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!
clipAccountName :: Int -> AccountName -> AccountNameSource
Produced by Haddock version 2.6.0