dangit.. simplify combineJournalUpdates for real

This commit is contained in:
Simon Michael 2015-10-13 11:54:15 -07:00
parent 3be88ad6b5
commit 8214a6ccef

View File

@ -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