Keyboard shortcuts

Press ← or → to navigate between chapters

Press S or / to search in the book

Press ? to show this help

Press Esc to hide this help

Account titles and their attributes

AccountTitles is the element type for account titles. Each constructor, such as Cash, is an element. The wildcard element AccountTitle has no account attributes. Both accountSpec AccountTitle and accountSemantics AccountTitle return Nothing.

Account specification

Use accountSpec to get the AccountSpec record for a concrete account title.

  • asDivision gives the division. The values are Assets for assets, Liability for liabilities, Equity for equity, Revenue for revenue, and Cost for expenses.
  • asClosing gives the automatic closing rule. CloseByDivision uses the division to determine eligibility and transfer direction. NoClose skips automatic closing for the account.
  • asIsContra identifies contra accounts, which offset balances in their division.
  • asFixedCurrent classifies the account as Fixed, Current, or Other. For example, revenue and expense accounts use Other.
  • asNameEn gives the English name. asNameJa gives the Japanese name, which may include notes. asLabelJa gives the Japanese display name without notes.
  • asDescription gives a description of the account.
  • asAliases lists the aliases in the registry. accountAliases combines these with aliases from the Japan Chamber of Commerce and Industry’s account names.

Account semantics

Use accountSemantics to get the AccountSemantics record for bookkeeping and reporting.

  • asemRoles lists the roles of the account. An account can have multiple roles. OrdinaryAccount marks an ordinary account, ContraAccount offsets another balance, and ReciprocalAccount matches balances between entities. SuspenseOrClearingAccount holds amounts temporarily. ClosingDevice supports closing entries. AttributionAccount assigns amounts to a group. PeriodResult represents a period result and ReportingSubtotal represents a subtotal.
  • asemPostingCapability describes where the account may be used. OrdinaryPosting allows ordinary entries. ClosingOnly, ConsolidationOnly, and EngineGeneratedOnly limit use to closing, consolidation, and entries generated by the library, respectively. NotPostable marks an account unavailable for recording entries.
  • asemDivisionSemantics explains what the division represents. StatementDivision gives a financial statement classification. BookkeepingControlClass gives a class used to control a bookkeeping procedure. DirectionEncoding uses the division to encode direction. NoStatementDivision indicates that no statement division applies.
  • asemHomeSideSemantics describes the home side, the debit or credit side on which you record an increase in the account. FixedHomeSide specifies Debit or Credit. ContextDependentHomeSide depends on the context. NoFixedHomeSide gives no single home side. NoPostingSide means that no posting side applies.
  • asemReportingEligibility describes eligibility for financial statement presentation. StatementEligible marks an eligible account. ContextualPresentation depends on the reporting context. DerivedPresentation represents a derived result or subtotal. NotPresented excludes the account from presentation.

Where the attributes are used

  • Closing entries use the closing rule and division to select accounts to close. The division and contra status determine the transfer direction.
  • Financial statements use the statement division and the fixed/current classification to group lines. The ContraAccount role determines whether a balance is presented as a deduction.
  • Reading journals from CSV uses accountAliases to resolve alternate names.
  • Trial balance and checks use the home side to flag ordinary accounts with a balance on the opposite side. They use roles to check balances in accounts such as suspense and clearing accounts.

Compare cash and accumulated depreciation

This program prints the classification and semantics for Cash and AccumulatedDepreciation, followed by the aliases for Cash.

module Main where

import ExchangeAlgebra
    ( AccountSemantics(..)
    , AccountSpec(..)
    , AccountTitles(..)
    , accountAliases
    , accountSemantics
    , accountSpec
    )
import System.Exit (die)

main :: IO ()
main = do
    describe Cash
    describe AccumulatedDepreciation
    mapM_ putStrLn (map (read . show) (accountAliases Cash) :: [String])

describe :: AccountTitles -> IO ()
describe title = case (accountSpec title, accountSemantics title) of
    (Just spec, Just semantics) ->
        mapM_ putStrLn
            [ show title
            , show (asDivision spec, asClosing spec, asIsContra spec, asFixedCurrent spec)
            , show (asemRoles semantics, asemPostingCapability semantics)
            , show (asemDivisionSemantics semantics, asemHomeSideSemantics semantics)
            , show (asemReportingEligibility semantics)
            ]
    _ -> die "Missing account attributes"
Cash
(Assets,CloseByDivision,False,Current)
([OrdinaryAccount],OrdinaryPosting)
(StatementDivision Assets,FixedHomeSide Debit)
StatementEligible
AccumulatedDepreciation
(Assets,CloseByDivision,True,Fixed)
([OrdinaryAccount,ContraAccount],OrdinaryPosting)
(StatementDivision Assets,FixedHomeSide Credit)
StatementEligible
現金

Tested with exchangealgebra-0.6.1.1 on 2026-11-20.

English names shared by multiple accounts

Use constructor names or Japanese names to distinguish accounts that share an English name. The built-in list gives both. In exchangealgebra-0.6.1.1, the following pairs share an asNameEn value.

  • Retained earnings (RetainedEarnings and EarnedSurplus)
  • Supplies (SuppliesExpenses and SuppliesOnHand)
  • Central bank payment to treasury (CentralBankPaymentExpense and CentralBankPaymentIncome)
  • Provision for repairs (AllowanceForRepairs and ProvisionForRepairs)
  • Provision for warranties (AllowanceForProductWarranties and ProvisionForProductWarranties)
  • Provision for bonuses (AllowanceForBonuses and ProvisionForBonuses)

The English name of Building is “Real estate”.