]> Git — Sourcephile - comptalang.git/blob - lib/Hcompta/Lib/Collections.hs
Polissage : n'utilise pas TypeSynonymInstances.
[comptalang.git] / lib / Hcompta / Lib / Collections.hs
1
2 -- import qualified Data.Collections as C
3 -- import qualified Data.Collections.Foldable as CF
4 -- import Data.Collections.BaseInstances ()
5 {-
6 instance CF.Foldable (Data.List.NonEmpty.NonEmpty a) a where
7 foldMap = Data.Foldable.foldMap
8
9 class
10 ( CF.Foldable account account_name
11 , C.Map amounts unit amount
12 , Num amount
13 , Ord unit
14 ) =>
15 Class_Posting posting account account_name amounts amount unit
16 where
17 posting_account :: posting -> account
18 posting_amounts :: posting -> amounts
19 posting_nil :: account -> amounts -> posting
20 -}
21 {-
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}
26 -}
27
28 {-
29 class Num amount => Amount amount quantity unit
30 where
31 amount_quantity :: amount -> quantity
32 amount_unit :: amount -> unit
33 amount_is_zero :: amount -> Bool
34 -}