Compute the union of imp_finsts on the side
I've explained most of the rationale in a new Note.
I'd happily add a test for this, but the difference is only
visible in run time, allocations remain more or less the same.
FWIW running generateModules from Trac #14693 with DEPTH=16, WIDTH=30
finishes in 23s before, and 11s after.
Test Plan: ./validate
Reviewers: simonpj, simonmar, bgamari
Reviewed By: simonpj
Subscribers: rwbarton, thomie, carter
GHC Trac Issues: Trac #14693
Differential Revision: https://phabricator.haskell.org/D4369