@@ -407,6 +407,7 @@ module Development.IDE.GHC.Compat.Core (
407
407
field_label ,
408
408
#endif
409
409
groupOrigin ,
410
+ isVisibleFunArg ,
410
411
) where
411
412
412
413
import qualified GHC
@@ -431,13 +432,13 @@ import GHC.Core.DataCon hiding (dataConExTyCoVars)
431
432
import qualified GHC.Core.DataCon as DataCon
432
433
import GHC.Core.FamInstEnv hiding (pprFamInst )
433
434
import GHC.Core.InstEnv
434
- import GHC.Types.Unique.FM
435
+ import GHC.Types.Unique.FM
435
436
import GHC.Core.PatSyn
436
437
import GHC.Core.Predicate
437
438
import GHC.Core.TyCo.Ppr
438
439
import qualified GHC.Core.TyCo.Rep as TyCoRep
439
440
import GHC.Core.TyCon
440
- import GHC.Core.Type
441
+ import GHC.Core.Type
441
442
import GHC.Core.Unify
442
443
import GHC.Core.Utils
443
444
import GHC.Driver.CmdLine (Warn (.. ))
@@ -489,6 +490,8 @@ import qualified GHC.Types.SrcLoc as SrcLoc
489
490
import GHC.Types.Unique.Supply
490
491
import GHC.Types.Var (Var (varName ), setTyVarUnique ,
491
492
setVarUnique )
493
+
494
+ import qualified GHC.Types.Var as TypesVar
492
495
import GHC.Unit.Info (PackageName (.. ))
493
496
import GHC.Unit.Module hiding (ModLocation (.. ), UnitId ,
494
497
moduleUnit ,
@@ -597,7 +600,7 @@ pattern RealSrcLoc x y = SrcLoc.RealSrcLoc x y
597
600
pattern AvailTC :: Name -> [Name ] -> [FieldLabel ] -> Avail. AvailInfo
598
601
#if __GLASGOW_HASKELL__ >= 907
599
602
pattern AvailTC n names pieces <- Avail. AvailTC n ((,[] ) -> (names,pieces))
600
- #else
603
+ #else
601
604
pattern AvailTC n names pieces <- Avail. AvailTC n ((\ gres -> foldr (\ gre (names, pieces) -> case gre of
602
605
Avail. NormalGreName name -> (name: names, pieces)
603
606
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,
606
609
pattern AvailName :: Name -> Avail. AvailInfo
607
610
#if __GLASGOW_HASKELL__ >= 907
608
611
pattern AvailName n <- Avail. Avail n
609
- #else
612
+ #else
610
613
pattern AvailName n <- Avail. Avail (Avail. NormalGreName n)
611
614
#endif
612
615
613
616
pattern AvailFL :: FieldLabel -> Avail. AvailInfo
614
617
#if __GLASGOW_HASKELL__ >= 907
615
618
pattern AvailFL fl <- (const Nothing -> Just fl) -- this pattern always fails as this field was removed in 9.7
616
- #else
619
+ #else
617
620
pattern AvailFL fl <- Avail. Avail (Avail. FieldGreName fl)
618
621
#endif
619
622
@@ -630,8 +633,17 @@ pattern ExposePackage s a mr <- DynFlags.ExposePackage s a _ mr
630
633
pattern ExposePackage s a mr = DynFlags. ExposePackage s a mr
631
634
#endif
632
635
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
+
635
647
636
648
-- type HasSrcSpan x a = (GenLocated SrcSpan a ~ x)
637
649
-- type HasSrcSpan x = () :: Constraint
0 commit comments