[commit: ghc] master: Don't use $ in the definition of (<**>) in GHC.Base (683ed47)

git at git.haskell.org git at git.haskell.org
Tue Jan 3 05:52:26 UTC 2017


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

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

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

commit 683ed475964bbd90030deb8f738370ae90b48a22
Author: Matthew Pickering <matthewtpickering at gmail.com>
Date:   Tue Jan 3 00:22:03 2017 -0500

    Don't use $ in the definition of (<**>) in GHC.Base
    
    ($) is special as Richard explains in the note at the top of the page.
    
    However, when adding the note he didn't remove this usage. Normally it
    didn't cause any problems as the optimiser optimised it away. However if
    one had the propensity to stick one's fingers into the depths of the
    inliner, it caused horrible idInfo panics.
    
    Reviewers: rwbarton, hvr, austin, bgamari
    
    Reviewed By: bgamari
    
    Subscribers: thomie
    
    Differential Revision: https://phabricator.haskell.org/D2913
    
    GHC Trac Issues: #13055


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

683ed475964bbd90030deb8f738370ae90b48a22
 libraries/base/GHC/Base.hs | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/libraries/base/GHC/Base.hs b/libraries/base/GHC/Base.hs
index 34a038d..490596e 100644
--- a/libraries/base/GHC/Base.hs
+++ b/libraries/base/GHC/Base.hs
@@ -423,7 +423,8 @@ class Functor f => Applicative f where
 
 -- | A variant of '<*>' with the arguments reversed.
 (<**>) :: Applicative f => f a -> f (a -> b) -> f b
-(<**>) = liftA2 (flip ($))
+(<**>) = liftA2 (\a f -> f a)
+-- Don't use $ here, see the note at the top of the page
 
 -- | Lift a function to actions.
 -- This function may be used as a value for `fmap` in a `Functor` instance.



More information about the ghc-commits mailing list