From 6926003c46666ed1c19c9980949be9cc6a6053ae Mon Sep 17 00:00:00 2001 From: ndwarshuis Date: Tue, 13 Jun 2023 20:32:12 -0400 Subject: [PATCH] ENH assault user's face with all errors at once --- lib/Internal/History.hs | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/lib/Internal/History.hs b/lib/Internal/History.hs index 3042569..b1f05c3 100644 --- a/lib/Internal/History.hs +++ b/lib/Internal/History.hs @@ -116,9 +116,7 @@ txPair day from to cur val desc = tx resolveTx :: (MonadInsertError m, MonadFinance m) => BalTx -> m KeyTx resolveTx t@Tx {txEntries = ss} = - fmap (\kss -> t {txEntries = kss}) $ - combineErrors $ - fmap resolveEntry ss + fmap (\kss -> t {txEntries = kss}) $ combineErrors $ fmap resolveEntry ss insertTx :: MonadSqlQuery m => CommitRId -> KeyTx -> m () insertTx c Tx {txDate = d, txDescr = e, txEntries = ss} = do @@ -330,7 +328,7 @@ balanceTxs => [(CommitR, RawTx)] -> m [(CommitR, KeyTx)] balanceTxs ts = do - bs <- mapM balanceTx $ snd $ L.mapAccumR balanceTxTargets M.empty ts' + bs <- mapErrors balanceTx $ snd $ L.mapAccumR balanceTxTargets M.empty ts' return $ zip cs bs where (cs, ts') = L.unzip $ L.sortOn (txDate . snd) ts