From 8939c1f7b7dd1175d06c21f995c463bb1476caa9 Mon Sep 17 00:00:00 2001 From: Simon Michael Date: Sat, 8 Nov 2008 22:49:14 +0000 Subject: [PATCH] samesymbol cleanup --- Ledger/RawLedger.hs | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/Ledger/RawLedger.hs b/Ledger/RawLedger.hs index 319fc2dd9..0d372be7b 100644 --- a/Ledger/RawLedger.hs +++ b/Ledger/RawLedger.hs @@ -100,10 +100,9 @@ canonicaliseAmounts l@(RawLedger ms ps es f) = RawLedger ms ps (map fixEntryAmou commoditieswithsymbol s = fromMaybe (error $ "no such commodity "++s) (Map.lookup s commoditiesmap) where commoditiesmap :: Map.Map String [Commodity] - commoditiesmap = Map.fromList [(symbol $ head cs,cs) | + commoditiesmap = Map.fromList [(symbol $ head cs,cs) | cs <- groupBy samesymbol $ rawLedgerCommodities l] - samesymbol :: Commodity -> Commodity -> Bool - samesymbol (Commodity{symbol=s1}) (Commodity{symbol=s2}) = s1==s2 + samesymbol c1 c2 = symbol c1 == symbol c2 rawLedgerAmounts :: RawLedger -> [MixedAmount] rawLedgerAmounts = map amount . rawLedgerTransactions