base: define `sequence = mapM id`
authorDavid Feuer <David.Feuer@gmail.com>
Thu, 13 Nov 2014 08:05:22 +0000 (09:05 +0100)
committerHerbert Valerio Riedel <hvr@gnu.org>
Thu, 13 Nov 2014 08:05:43 +0000 (09:05 +0100)
commitc016e6f74e26708586352fec657798f271b0675b
tree38da31b1d679c23599627d9f3f3b810c25069f11
parente73ab5412935392c03ce736ebee2b1282932c2ff
base: define `sequence = mapM id`

This avoids duplication in `GHC.Base`; originally, we had

  mapM f = sequence . map f

This led to excessive allocation in `cryptarithm2`. Defining

  sequence = mapM id

does not appear to cause any `nofib` problems.

Reviewed By: hvr

Differential Revision: https://phabricator.haskell.org/D470
libraries/base/GHC/Base.hs