;lib: more docs for unifyMixedAmount

[ci skip]
This commit is contained in:
Simon Michael 2019-11-18 17:22:42 -08:00
parent 69ee21cf16
commit 4cb2a03f7f

View File

@ -196,6 +196,10 @@ brNegate (is, tot) = (map brItemNegate is, -tot)
brItemNegate (a, a', d, amt) = (a, a', d, -amt)
-- | Helper to unify a MixedAmount to a single commodity value.
-- Like normaliseMixedAmount, this consolidates amounts of the same commodity
-- and discards zero amounts; but this one insists on simplifying to
-- a single commodity, and will throw a program-terminating error if
-- this is not possible.
unifyMixedAmount :: MixedAmount -> Amount
unifyMixedAmount mixedAmount = foldl combine (num 0) (amounts mixedAmount)
where