[commit: ghc] master: base: MRP-refactoring of AMP instances (e737a51)

git at git.haskell.org git at git.haskell.org
Mon Oct 12 09:41:36 UTC 2015


Repository : ssh://git@git.haskell.org/ghc

On branch  : master
Link       : http://ghc.haskell.org/trac/ghc/changeset/e737a5126dcfdd0610587d2ec16bea6481cf2a42/ghc

>---------------------------------------------------------------

commit e737a5126dcfdd0610587d2ec16bea6481cf2a42
Author: Herbert Valerio Riedel <hvr at gnu.org>
Date:   Mon Oct 12 11:36:01 2015 +0200

    base: MRP-refactoring of AMP instances
    
    This refactors `(>>)`/`(*>)`/`return`/`pure` methods into normal form.
    
    The redundant explicit `return` method definitions are dropped
    altogether.
    
    The explicit `(>>) = (*>)` definitions can't be removed yet, as
    the default implementation of `(>>)` is still in terms of `(*>)`
    (even though that should have been changed according to the AMP but
    wasn't -- see note in GHC.Base for details why this had to be postponed)
    
    A nofib comparision shows this refactoring to result in minor runtime
    improvements (unless those are within normal measurement fluctuations):
    
            Program           Size    Allocs   Runtime   Elapsed  TotalMem
      -------------------------------------------------------------------------
                Min          -0.0%     -0.0%     -1.6%     -3.9%     -1.1%
                Max          -0.0%     +0.0%     +0.5%     +0.5%      0.0%
      Geometric Mean         -0.0%     -0.0%     -0.4%     -0.5%     -0.0%
    
    Full `nofib` report at https://phabricator.haskell.org/P68
    
    Reviewers: quchen, alanz, austin, #core_libraries_committee, bgamari
    
    Reviewed By: bgamari
    
    Differential Revision: https://phabricator.haskell.org/D1316


>---------------------------------------------------------------

e737a5126dcfdd0610587d2ec16bea6481cf2a42
 libraries/base/Control/Applicative.hs             |  2 +-
 libraries/base/Control/Arrow.hs                   |  1 -
 libraries/base/Control/Monad/ST/Lazy/Imp.hs       |  4 +---
 libraries/base/Data/Complex.hs                    |  1 -
 libraries/base/Data/Either.hs                     |  1 -
 libraries/base/Data/Functor/Identity.hs           |  1 -
 libraries/base/Data/List/NonEmpty.hs              |  1 -
 libraries/base/Data/Monoid.hs                     |  3 ---
 libraries/base/Data/Proxy.hs                      |  2 --
 libraries/base/Data/Semigroup.hs                  | 21 ++++++++-------------
 libraries/base/Data/Traversable.hs                |  4 ++--
 libraries/base/Data/Version.hs                    |  9 +++++----
 libraries/base/GHC/Base.hs                        | 18 +++++++-----------
 libraries/base/GHC/Conc/Sync.hs                   | 12 ++++++------
 libraries/base/GHC/GHCi.hs                        |  3 +--
 libraries/base/GHC/ST.hs                          | 11 +++++------
 libraries/base/Text/ParserCombinators/ReadP.hs    |  7 ++-----
 libraries/base/Text/ParserCombinators/ReadPrec.hs |  3 +--
 18 files changed, 39 insertions(+), 65 deletions(-)

Diff suppressed because of size. To see it, use:

    git diff-tree --root --patch-with-stat --no-color --find-copies-harder --ignore-space-at-eol --cc e737a5126dcfdd0610587d2ec16bea6481cf2a42


More information about the ghc-commits mailing list