Safe Haskell | None |
---|
AccountName
s are strings like assets:cash:petty
, with multiple
components separated by :
. From a set of these we derive the account
hierarchy.
- acctsepchar :: Char
- accountNameComponents :: AccountName -> [String]
- accountNameFromComponents :: [String] -> AccountName
- accountLeafName :: AccountName -> String
- accountNameLevel :: AccountName -> Int
- accountNameDrop :: Int -> AccountName -> AccountName
- expandAccountNames :: [AccountName] -> [AccountName]
- expandAccountName :: 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
- nullaccountnametree :: Tree [Char]
- elideAccountName :: Int -> AccountName -> AccountName
- clipAccountName :: Int -> AccountName -> AccountName
- accountNameToAccountRegex :: String -> String
- accountNameToAccountOnlyRegex :: String -> String
- accountRegexToAccountName :: String -> String
- isAccountRegex :: String -> Bool
- tests_Hledger_Data_AccountName :: Test
Documentation
accountNameDrop :: Int -> AccountName -> AccountNameSource
expandAccountNames :: [AccountName] -> [AccountName]Source
topAccountNames :: [AccountName] -> [AccountName]Source
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.
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
accountNameToAccountRegex :: String -> StringSource
Convert an account name to a regular expression matching it and its subaccounts.
accountNameToAccountOnlyRegex :: String -> StringSource
Convert an account name to a regular expression matching it but not its subaccounts.
accountRegexToAccountName :: String -> StringSource
Convert an exact account-matching regular expression to a plain account name.
isAccountRegex :: String -> BoolSource
Does this string look like an exact account-matching regular expression ?