From 68f13e18afe0d963d8182c527856f4b52708c320 Mon Sep 17 00:00:00 2001 From: Simon Michael Date: Wed, 31 Aug 2011 17:22:53 +0000 Subject: [PATCH] amount haddock updates --- hledger-lib/Hledger/Data/Amount.hs | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/hledger-lib/Hledger/Data/Amount.hs b/hledger-lib/Hledger/Data/Amount.hs index 8bcbd1ffe..ab06c1033 100644 --- a/hledger-lib/Hledger/Data/Amount.hs +++ b/hledger-lib/Hledger/Data/Amount.hs @@ -1,7 +1,7 @@ {-# LANGUAGE StandaloneDeriving #-} {-| -A simple "Amount" is some quantity of money, shares, or anything else. -It has a (possibly null) "Commodity" and a numeric quantity: +A simple 'Amount' is some quantity of money, shares, or anything else. +It has a (possibly null) 'Commodity' and a numeric quantity: @ $1 @@ -13,14 +13,16 @@ It has a (possibly null) "Commodity" and a numeric quantity: 0 @ -It may also have an assigned unit price, which is another (unpriced) -simple amount in a different commodity. If present, this is rendered like so: +It may also have an assigned 'Price', representing this amount's per-unit +or total cost in a different commodity. If present, this is rendered like +so: @ - EUR 3 \@ $1.35 + EUR 2 \@ $1.50 (unit price) + EUR 2 \@\@ $3 (total price) @ -A "MixedAmount" is zero or more simple amounts, so can represent multiple +A 'MixedAmount' is zero or more simple amounts, so can represent multiple commodities; this is the type most often used: @ @@ -33,14 +35,12 @@ When a mixed amount has been \"normalised\", it has no more than one amount in each commodity and no zero amounts; or it has just a single zero amount and no others. -We can do two kinds of limited arithmetic with simple or mixed amounts: -price-preserving (for amounts with the same prices) or price-ignoring -(ignores and discards any prices). +Limited arithmetic with simple and mixed amounts is supported, best used +with similar amounts since it mostly ignores assigned prices and commodity +exchange rates. -} --- XXX due for review/rewrite - module Hledger.Data.Amount ( -- * Amount nullamt,