diff --git a/trace-foreign-calls/src/Plugin/TraceForeignCalls/GHC/Shim.hs b/trace-foreign-calls/src/Plugin/TraceForeignCalls/GHC/Shim.hs index eb9741c..8905607 100644 --- a/trace-foreign-calls/src/Plugin/TraceForeignCalls/GHC/Shim.hs +++ b/trace-foreign-calls/src/Plugin/TraceForeignCalls/GHC/Shim.hs @@ -22,7 +22,7 @@ import GHC.Tc.Utils.Monad (TcGblEnv) import Plugin.TraceForeignCalls.GHC.Util mkLambda :: [LPat GhcRn] -> LHsExpr GhcRn -> LHsExpr GhcRn -#if __GLASGOW_HASKELL__ >= 912 +#if MIN_VERSION_ghc(9,12,1) mkLambda = mkHsLam . noLocValue #else mkLambda = mkHsLam @@ -33,13 +33,13 @@ mkSimpleFunRhs name = FunRhs { mc_fun = name , mc_fixity = Prefix , mc_strictness = NoSrcStrict -#if __GLASGOW_HASKELL__ >= 912 +#if MIN_VERSION_ghc(9,12,1) , mc_an = AnnFunRhs NoEpTok [] [] #endif } mkValBinds :: [(RecFlag, [LHsBind GhcRn])] -> [LSig GhcRn] -> HsValBinds GhcRn -#if __GLASGOW_HASKELL__ >= 912 +#if MIN_VERSION_ghc(9,12,1) mkValBinds bindingGroups sigs = XValBindsLR $ NValBinds bindingGroups sigs @@ -53,7 +53,7 @@ extendValBinds :: [(RecFlag, [LHsBind GhcRn])] -> [LSig GhcRn] -> HsValBinds GhcRn -> HsValBinds GhcRn -#if __GLASGOW_HASKELL__ >= 912 +#if MIN_VERSION_ghc(9,12,1) extendValBinds newBindingGroups newSigs old = case old of XValBindsLR (NValBinds oldGroups oldSigs) -> @@ -88,13 +88,13 @@ mkSimpleFunBind name freeVars args body = noLocValue $ FunBind { mg_ext = Generated OtherExpansion SkipPmc , mg_alts = noLocValue . map noLocValue $ [ Match { -#if __GLASGOW_HASKELL__ >= 912 +#if MIN_VERSION_ghc(9,12,1) m_ext = noValue #else m_ext = noAnn -#endif +#endif , m_ctxt = mkSimpleFunRhs name -#if __GLASGOW_HASKELL__ >= 912 +#if MIN_VERSION_ghc(9,12,1) , m_pats = noLocValue $ map namedVarPat args #else , m_pats = map namedVarPat args