[commit: ghc] master: Improve Applicative definitions (abba381)

git at git.haskell.org git at git.haskell.org
Fri Nov 7 07:38:31 UTC 2014


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

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

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

commit abba3812e657a5267bba406d2c877c1cb5d978f9
Author: David Feuer <David.Feuer at gmail.com>
Date:   Fri Nov 7 08:12:21 2014 +0100

    Improve Applicative definitions
    
    Generally clean up things relating to Applicative and Monad in `GHC.Base`
    and `Control.Applicative` to make `Applicative` feel like a bit more of a
    first-class citizen rather than just playing second fiddle to `Monad`. Use
    `coerce` and GND to improve performance and clarity.
    
    Change the default definition of `(*>)` to use `(<$)`, in case the
    `Functor` instance optimizes that.
    
    Moreover, some manually written instances are made into compiler-derived
    instances.
    
    Finally, this also adds a few AMP-related laws to the `Applicative` docstring.
    
    NOTE: These changes result in a 13% decrease in allocation for T9020
    
    Reviewed By: ekmett, hvr
    
    Differential Revision: https://phabricator.haskell.org/D432


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

abba3812e657a5267bba406d2c877c1cb5d978f9
 compiler/basicTypes/UniqSupply.lhs                 |  1 +
 compiler/simplCore/SimplMonad.lhs                  |  3 +-
 libraries/base/Control/Applicative.hs              | 28 ++++-----
 libraries/base/GHC/Base.lhs                        | 69 +++++++++++++++-------
 testsuite/tests/perf/compiler/all.T                |  3 +-
 .../tests/simplCore/should_compile/T8848.stderr    |  7 +--
 6 files changed, 67 insertions(+), 44 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 abba3812e657a5267bba406d2c877c1cb5d978f9


More information about the ghc-commits mailing list