Skip to content
  • Herbert Valerio Riedel's avatar
    base: MRP-refactoring of AMP instances · e737a512
    Herbert Valerio Riedel authored
    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
    e737a512