@@ -103,8 +103,10 @@ accountFromBalances name bal = Account
103
103
, abalances = bal
104
104
}
105
105
106
- -- | Derive 1. an account tree and 2. each account's total exclusive
107
- -- and inclusive changes from a list of postings.
106
+ -- | Derive 1. an account tree and 2. each account's total exclusive and
107
+ -- inclusive changes associated with dates from a list of postings and a
108
+ -- function for associating a date to each posting (usually representing the
109
+ -- start dates of report subperiods).
108
110
-- This is the core of the balance command (and of *ledger).
109
111
-- The accounts are returned as a list in flattened tree order,
110
112
-- and also reference each other as a tree.
@@ -113,9 +115,11 @@ accountsFromPostings :: (Posting -> Maybe Day) -> [Posting] -> [Account AccountB
113
115
accountsFromPostings getPostingDate = flattenAccounts . accountFromPostings getPostingDate
114
116
115
117
-- | Derive 1. an account tree and 2. each account's total exclusive
116
- -- and inclusive changes from a list of postings.
118
+ -- and inclusive changes associated with dates from a list of postings and a
119
+ -- function for associating a date to each posting (usually representing the
120
+ -- start dates of report subperiods).
117
121
-- This is the core of the balance command (and of *ledger).
118
- -- The accounts are returned as tree.
122
+ -- The accounts are returned as a tree.
119
123
accountFromPostings :: (Posting -> Maybe Day ) -> [Posting ] -> Account AccountBalance
120
124
accountFromPostings getPostingDate ps =
121
125
tieAccountParents . sumAccounts $ mapAccounts setBalance acctTree
0 commit comments