hledger/Ledger/Account.hs

24 lines
549 B
Haskell
Raw Normal View History

{-|
2008-10-18 04:52:49 +04:00
An 'Account' stores, for efficiency: an 'AccountName', all transactions in
the account (excluding subaccounts), and the account balance (including
subaccounts).
-}
module Ledger.Account
where
import Ledger.Utils
2008-10-03 04:12:59 +04:00
import Ledger.Types
import Ledger.Amount
instance Show Account where
show (Account a ts b) = printf "Account %s with %d txns and %s balance" a (length ts) (showMixedAmount b)
2008-10-18 04:52:49 +04:00
instance Eq Account where
(==) (Account n1 t1 b1) (Account n2 t2 b2) = n1 == n2 && t1 == t2 && b1 == b2
2008-11-22 20:21:49 +03:00
nullacct = Account "" [] nullmixedamt