[Git][ghc/ghc][wip/jeltsch/improve-closure-property-check] Change the implementation of `collect` so that it uses `concatMapM`