Safe Haskell | Safe-Infered |
---|
- data Balance
- unBalance :: Balance -> Map Commodity BottomLine
- data Balanced
- = Balanced
- | Inferable Entry
- | NotInferable
- isBalanced :: Balance -> Balanced
- entryToBalance :: Entry -> Balance
- addBalances :: Balance -> Balance -> Balance
- removeZeroCommodities :: Balance -> Maybe Balance
- data BottomLine
- data Column = Column {}
Documentation
A balance summarizes several entries. You do not create a Balance
directly. Instead, use entryToBalance
. Balance used to be a
monoid, but there is nothing appropriate for mempty. Instead,
Balance is really a semigroup, but not a monoid.
Returned by isBalanced
.
isBalanced :: Balance -> BalancedSource
Is this balance balanced?
entryToBalance :: Entry -> BalanceSource
Converts an Entry to a Balance.
addBalances :: Balance -> Balance -> BalanceSource
Add two Balances together. Commodities are never removed from the balance, even if their balance is zero. Instead, they are left in the balance. Sometimes you want to know that a commodity was in the account but its balance is now zero.
removeZeroCommodities :: Balance -> Maybe BalanceSource
Removes zero balances from a Balance. Will not return a Balance with no commodities; instead, returns Nothing if there would be a balance with no commodities.