[commit: ghc] wip/all-inlinable: Don't use $ in the definition of (<**>) in GHC.Base (9a98745)

git at git.haskell.org git at git.haskell.org
Tue Jan 3 03:16:49 UTC 2017


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

On branch  : wip/all-inlinable
Link       : http://ghc.haskell.org/trac/ghc/changeset/9a9874502f57e43bde5af6de63b503301194277b/ghc

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

commit 9a9874502f57e43bde5af6de63b503301194277b
Author: Matthew Pickering <matthewtpickering at gmail.com>
Date:   Tue Jan 3 03:07:44 2017 +0000

    Don't use $ in the definition of (<**>) in GHC.Base
    
    Summary:
    ($) 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: austin, rwbarton, hvr, bgamari
    
    Subscribers: thomie
    
    Differential Revision: https://phabricator.haskell.org/D2913


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

9a9874502f57e43bde5af6de63b503301194277b
 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 2edce60..5d62ff2 100644
--- a/libraries/base/GHC/Base.hs
+++ b/libraries/base/GHC/Base.hs
@@ -410,7 +410,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