From 8214a6ccefeb4bdf16ebe00ffd3841fec04c876a Mon Sep 17 00:00:00 2001 From: Simon Michael Date: Tue, 13 Oct 2015 11:54:15 -0700 Subject: [PATCH] dangit.. simplify combineJournalUpdates for real --- hledger-lib/Hledger/Read/JournalReader.hs | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/hledger-lib/Hledger/Read/JournalReader.hs b/hledger-lib/Hledger/Read/JournalReader.hs index 225d8ce04..8965093e0 100644 --- a/hledger-lib/Hledger/Read/JournalReader.hs +++ b/hledger-lib/Hledger/Read/JournalReader.hs @@ -105,9 +105,8 @@ genericSourcePos p = GenericSourcePos (sourceName p) (sourceLine p) (sourceColum -- monadic actions which can do IO or raise an exception) into a -- single equivalent action. combineJournalUpdates :: [JournalUpdate] -> JournalUpdate -combineJournalUpdates us = liftM (foldl' (\acc new x -> new (acc x)) id) $ sequence us +combineJournalUpdates us = foldl' (flip (.)) id <$> sequence us -- XXX may be contributing to excessive stack use ---combineJournalUpdates us = foldl' (flip (.)) id <$> sequence us -- cf http://neilmitchell.blogspot.co.uk/2015/09/detecting-space-leaks.html -- $ ./devprof +RTS -K576K -xc