[commit: ghc] master: Use fmap instead of <$> (Fixes #10407) (c119a80)

git at git.haskell.org git at git.haskell.org
Tue May 12 05:24:02 UTC 2015


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

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

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

commit c119a8020f4e3073460e2c350507d5cf65771cea
Author: Erik de Castro Lopo <erikd at mega-nerd.com>
Date:   Tue May 12 14:52:16 2015 +1000

    Use fmap instead of <$> (Fixes #10407)
    
    The <$> operator is only available in the standard Prelude in
    ghc 7.10 and later.
    
    Signed-off-by: Erik de Castro Lopo <erikd at mega-nerd.com>
    
    Test Plan: build with ghc-7.6
    
    Reviewers: dterei, ezyang, austin
    
    Subscribers: bgamari, thomie
    
    Differential Revision: https://phabricator.haskell.org/D886
    
    GHC Trac Issues: #10407


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

c119a8020f4e3073460e2c350507d5cf65771cea
 compiler/typecheck/TcInteract.hs | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/compiler/typecheck/TcInteract.hs b/compiler/typecheck/TcInteract.hs
index 33ff043..95715fe 100644
--- a/compiler/typecheck/TcInteract.hs
+++ b/compiler/typecheck/TcInteract.hs
@@ -2030,8 +2030,8 @@ matchClassInst inerts clas tys loc
         ; traceTcS "matchClassInst" $ vcat [ text "pred =" <+> ppr pred
                                            , text "inerts=" <+> ppr inerts ]
         ; instEnvs <- getInstEnvs
-        ; safeOverlapCheck <- (`elem` [Sf_Safe, Sf_Trustworthy])
-            <$> safeHaskell <$> getDynFlags
+        ; safeOverlapCheck <- ((`elem` [Sf_Safe, Sf_Trustworthy]) . safeHaskell)
+                            `fmap` getDynFlags
         ; let (matches, unify, unsafeOverlaps) = lookupInstEnv True instEnvs clas tys
               safeHaskFail = safeOverlapCheck && not (null unsafeOverlaps)
         ; case (matches, unify, safeHaskFail) of



More information about the ghc-commits mailing list