diff --git a/hledger-lib/Hledger/Read/JournalReader.hs b/hledger-lib/Hledger/Read/JournalReader.hs index ec3861c57..225d8ce04 100644 --- a/hledger-lib/Hledger/Read/JournalReader.hs +++ b/hledger-lib/Hledger/Read/JournalReader.hs @@ -101,10 +101,14 @@ parse _ = parseJournalWith journal genericSourcePos :: SourcePos -> GenericSourcePos genericSourcePos p = GenericSourcePos (sourceName p) (sourceLine p) (sourceColumn p) --- | Flatten a list of JournalUpdate's into a single equivalent one. +-- | Flatten a list of JournalUpdate's (journal-transforming +-- 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 -- 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 -- *** Exception (reporting due to +RTS -xc): (THUNK_STATIC), stack trace: