penny-lib-0.2.0.0: Extensible double-entry accounting system - library

Safe HaskellSafe-Infered

Penny.Copper.Account

Description

Account parsers. Account names fall into one of three groups:

  • Level 1 account. Can have nearly any character, including spaces. However, when in a Ledger file they must be quoted.
  • Level 2 account. The first sub-account begins with a letter. All other characters may be nearly any character, except for a space.

Synopsis

Documentation

render :: Account -> Maybe TextSource

Shows an account, with the minimum level of quoting possible. Fails with an error if any one of the characters in the account name does not satisfy the lvl1Char predicate. Otherwise returns a rendered account, quoted if necessary.

lvl1Char :: Char -> BoolSource

Characters allowed in a Level 1 account. (Check the source code to see what these are).

lvl2FirstChar :: Char -> BoolSource

Characters allowed for the first character of a Level 2 account.

lvl2RemainingChar :: Char -> BoolSource

Characters allowed for the remaining characters of a Level 2 account.