@@ -407,6 +407,7 @@ module Development.IDE.GHC.Compat.Core (
407407 field_label ,
408408#endif
409409 groupOrigin ,
410+ isVisibleFunArg ,
410411 ) where
411412
412413import qualified GHC
@@ -431,13 +432,13 @@ import GHC.Core.DataCon hiding (dataConExTyCoVars)
431432import qualified GHC.Core.DataCon as DataCon
432433import GHC.Core.FamInstEnv hiding (pprFamInst )
433434import GHC.Core.InstEnv
434- import GHC.Types.Unique.FM
435+ import GHC.Types.Unique.FM
435436import GHC.Core.PatSyn
436437import GHC.Core.Predicate
437438import GHC.Core.TyCo.Ppr
438439import qualified GHC.Core.TyCo.Rep as TyCoRep
439440import GHC.Core.TyCon
440- import GHC.Core.Type
441+ import GHC.Core.Type
441442import GHC.Core.Unify
442443import GHC.Core.Utils
443444import GHC.Driver.CmdLine (Warn (.. ))
@@ -489,6 +490,8 @@ import qualified GHC.Types.SrcLoc as SrcLoc
489490import GHC.Types.Unique.Supply
490491import GHC.Types.Var (Var (varName ), setTyVarUnique ,
491492 setVarUnique )
493+
494+ import qualified GHC.Types.Var as TypesVar
492495import GHC.Unit.Info (PackageName (.. ))
493496import GHC.Unit.Module hiding (ModLocation (.. ), UnitId ,
494497 moduleUnit ,
@@ -597,7 +600,7 @@ pattern RealSrcLoc x y = SrcLoc.RealSrcLoc x y
597600pattern AvailTC :: Name -> [Name ] -> [FieldLabel ] -> Avail. AvailInfo
598601#if __GLASGOW_HASKELL__ >= 907
599602pattern AvailTC n names pieces <- Avail. AvailTC n ((,[] ) -> (names,pieces))
600- #else
603+ #else
601604pattern AvailTC n names pieces <- Avail. AvailTC n ((\ gres -> foldr (\ gre (names, pieces) -> case gre of
602605 Avail. NormalGreName name -> (name: names, pieces)
603606 Avail. FieldGreName label -> (names, label: pieces)) ([] , [] ) gres) -> (names, pieces))
@@ -606,14 +609,14 @@ pattern AvailTC n names pieces <- Avail.AvailTC n ((\gres -> foldr (\gre (names,
606609pattern AvailName :: Name -> Avail. AvailInfo
607610#if __GLASGOW_HASKELL__ >= 907
608611pattern AvailName n <- Avail. Avail n
609- #else
612+ #else
610613pattern AvailName n <- Avail. Avail (Avail. NormalGreName n)
611614#endif
612615
613616pattern AvailFL :: FieldLabel -> Avail. AvailInfo
614617#if __GLASGOW_HASKELL__ >= 907
615618pattern AvailFL fl <- (const Nothing -> Just fl) -- this pattern always fails as this field was removed in 9.7
616- #else
619+ #else
617620pattern AvailFL fl <- Avail. Avail (Avail. FieldGreName fl)
618621#endif
619622
@@ -630,8 +633,17 @@ pattern ExposePackage s a mr <- DynFlags.ExposePackage s a _ mr
630633pattern ExposePackage s a mr = DynFlags. ExposePackage s a mr
631634#endif
632635
633- pattern FunTy :: Type -> Type -> Type
634- pattern FunTy arg res <- TyCoRep. FunTy {ft_arg = arg, ft_res = res}
636+ #if __GLASGOW_HASKELL__ >= 906
637+ isVisibleFunArg = TypesVar. isVisibleFunArg
638+ type FunTyFlag = TypesVar. FunTyFlag
639+ #else
640+ isVisibleFunArg VisArg = True
641+ isVisibleFunArg _ = False
642+ type FunTyFlag = TypesVar. AnonArgFlag
643+ #endif
644+ pattern FunTy :: Development.IDE.GHC.Compat.Core. FunTyFlag -> Type -> Type -> Type
645+ pattern FunTy af arg res <- TyCoRep. FunTy {ft_af = af, ft_arg = arg, ft_res = res}
646+
635647
636648-- type HasSrcSpan x a = (GenLocated SrcSpan a ~ x)
637649-- type HasSrcSpan x = () :: Constraint
0 commit comments