cmm/: Avoid using lazy left folds

Authored by michalt on Mar 3 2018, 10:22 AM.



This basically replaces all uses of foldl with foldl'. I've looked
at all the call sites and there doesn't seem to be any reason to prefer
the lazy version.

Signed-off-by: Michal Terepeta <>

Test Plan


Diff Detail

rGHC Glasgow Haskell Compiler
Automatic diff as part of commit; lint not applicable.
Automatic diff as part of commit; unit tests not applicable.
michalt created this revision.Mar 3 2018, 10:22 AM
bgamari accepted this revision.Mar 3 2018, 10:38 AM

Looks good to me.

One suggestion inline.


This might be more clearly written as

cafset = Set.unions cafsets `Set.difference` Set.fromList lbls

I suspect this will be slightly faster too as we will avoid allocating an intermediate set for each deletion.

This revision is now accepted and ready to land.Mar 3 2018, 10:38 AM
michalt updated this revision to Diff 15633.Mar 3 2018, 2:15 PM
  • Change suggested by bgamari
michalt marked an inline comment as done.Mar 3 2018, 2:16 PM
michalt added inline comments.

Nice! :)

michalt marked 2 inline comments as done.Mar 3 2018, 2:17 PM
This revision was automatically updated to reflect the committed changes.