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.
asDivisiongives the division. The values areAssetsfor assets,Liabilityfor liabilities,Equityfor equity,Revenuefor revenue, andCostfor expenses.asClosinggives the automatic closing rule.CloseByDivisionuses the division to determine eligibility and transfer direction.NoCloseskips automatic closing for the account.asIsContraidentifies contra accounts, which offset balances in their division.asFixedCurrentclassifies the account asFixed,Current, orOther. For example, revenue and expense accounts useOther.asNameEngives the English name.asNameJagives the Japanese name, which may include notes.asLabelJagives the Japanese display name without notes.asDescriptiongives a description of the account.asAliaseslists the aliases in the registry.accountAliasescombines 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.
asemRoleslists the roles of the account. An account can have multiple roles.OrdinaryAccountmarks an ordinary account,ContraAccountoffsets another balance, andReciprocalAccountmatches balances between entities.SuspenseOrClearingAccountholds amounts temporarily.ClosingDevicesupports closing entries.AttributionAccountassigns amounts to a group.PeriodResultrepresents a period result andReportingSubtotalrepresents a subtotal.asemPostingCapabilitydescribes where the account may be used.OrdinaryPostingallows ordinary entries.ClosingOnly,ConsolidationOnly, andEngineGeneratedOnlylimit use to closing, consolidation, and entries generated by the library, respectively.NotPostablemarks an account unavailable for recording entries.asemDivisionSemanticsexplains what the division represents.StatementDivisiongives a financial statement classification.BookkeepingControlClassgives a class used to control a bookkeeping procedure.DirectionEncodinguses the division to encode direction.NoStatementDivisionindicates that no statement division applies.asemHomeSideSemanticsdescribes the home side, the debit or credit side on which you record an increase in the account.FixedHomeSidespecifiesDebitorCredit.ContextDependentHomeSidedepends on the context.NoFixedHomeSidegives no single home side.NoPostingSidemeans that no posting side applies.asemReportingEligibilitydescribes eligibility for financial statement presentation.StatementEligiblemarks an eligible account.ContextualPresentationdepends on the reporting context.DerivedPresentationrepresents a derived result or subtotal.NotPresentedexcludes 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
ContraAccountrole determines whether a balance is presented as a deduction. - Reading journals from CSV uses
accountAliasesto 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 (
RetainedEarningsandEarnedSurplus) - Supplies (
SuppliesExpensesandSuppliesOnHand) - Central bank payment to treasury (
CentralBankPaymentExpenseandCentralBankPaymentIncome) - Provision for repairs (
AllowanceForRepairsandProvisionForRepairs) - Provision for warranties (
AllowanceForProductWarrantiesandProvisionForProductWarranties) - Provision for bonuses (
AllowanceForBonusesandProvisionForBonuses)
The English name of Building is “Real estate”.