2 -- import qualified Data.Collections as C
3 -- import qualified Data.Collections.Foldable as CF
4 -- import Data.Collections.BaseInstances ()
6 instance CF.Foldable (Data.List.NonEmpty.NonEmpty a) a where
7 foldMap = Data.Foldable.foldMap
10 ( CF.Foldable account account_name
11 , C.Map amounts unit amount
15 Class_Posting posting account account_name amounts amount unit
17 posting_account :: posting -> account
18 posting_amounts :: posting -> amounts
19 posting_nil :: account -> amounts -> posting
22 instance Class_Posting Posting Account Account.Name Amount.By_Unit Amount Amount.Unit where
23 posting_account = Posting.account
24 posting_amounts = Posting.amounts
25 posting_nil acct amounts = (Posting.nil acct) {Posting.amounts}
29 class Num amount => Amount amount quantity unit
31 amount_quantity :: amount -> quantity
32 amount_unit :: amount -> unit
33 amount_is_zero :: amount -> Bool