Skip to content

Commit 509e5bc

Browse files
committed
;doc: Improve documentation for account[s]FromPostings.
1 parent 0277e4d commit 509e5bc

File tree

1 file changed

+8
-4
lines changed

1 file changed

+8
-4
lines changed

hledger-lib/Hledger/Data/Account.hs

+8-4
Original file line numberDiff line numberDiff line change
@@ -103,8 +103,10 @@ accountFromBalances name bal = Account
103103
, abalances = bal
104104
}
105105

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).
108110
-- This is the core of the balance command (and of *ledger).
109111
-- The accounts are returned as a list in flattened tree order,
110112
-- and also reference each other as a tree.
@@ -113,9 +115,11 @@ accountsFromPostings :: (Posting -> Maybe Day) -> [Posting] -> [Account AccountB
113115
accountsFromPostings getPostingDate = flattenAccounts . accountFromPostings getPostingDate
114116

115117
-- | 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).
117121
-- 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.
119123
accountFromPostings :: (Posting -> Maybe Day) -> [Posting] -> Account AccountBalance
120124
accountFromPostings getPostingDate ps =
121125
tieAccountParents . sumAccounts $ mapAccounts setBalance acctTree

0 commit comments

Comments
 (0)