@@ -29,9 +29,7 @@ module GHC.SourceGen.Decl
2929    , derivingStock 
3030    , derivingAnyclass 
3131    , derivingNewtype 
32- #if  MIN_VERSION_ghc(8,6,0)
3332    , derivingVia 
34- #endif 
3533    , standaloneDeriving 
3634    , standaloneDerivingStock 
3735    , standaloneDerivingNewtype 
@@ -51,7 +49,6 @@ module GHC.SourceGen.Decl
5149    , patSynBind 
5250    ) where 
5351
54- #if  MIN_VERSION_ghc(9,0,0)
5552import  GHC  (LexicalFixity (Prefix ))
5653import  GHC.Data.Bag  (listToBag )
5754
@@ -62,14 +59,6 @@ import GHC (GhcPs, LayoutInfo (NoLayoutInfo))
6259#else 
6360import  GHC.Types.SrcLoc  (LayoutInfo (NoLayoutInfo ))
6461#endif 
65- 
66- #else 
67- import  BasicTypes  (LexicalFixity (Prefix ))
68- import  Bag  (listToBag )
69- #endif 
70- #if  !MIN_VERSION_ghc(8,6,0)
71- import  BasicTypes  (DerivStrategy (.. ))
72- #endif 
7362import  GHC.Hs.Binds 
7463import  GHC.Hs.Decls 
7564
@@ -86,29 +75,19 @@ import GHC.Hs.Type
8675    , HsSrcBang (.. )
8776    , HsType (.. )
8877    , LHsType 
89- #if  MIN_VERSION_ghc(8,6,0)
9078    , HsWildCardBndrs  (.. )
91- #endif 
92- #if  MIN_VERSION_ghc(8,8,0)
9379    , HsArg (.. )
94- #endif 
9580    , SrcStrictness (.. )
9681    , SrcUnpackedness (.. )
97- #if  MIN_VERSION_ghc(9,0,0)
9882    , hsUnrestricted 
99- #endif 
10083    )
10184
10285#if  MIN_VERSION_ghc(9,10,0)
10386import  GHC.Parser.Annotation  (AnnSortKey (.. ), EpAnn (.. ), EpLayout  (EpNoLayout ))
10487#elif  MIN_VERSION_ghc(9,2,0)
10588import  GHC.Parser.Annotation  (AnnSortKey (.. ), EpAnn (.. ))
106- #elif  MIN_VERSION_ghc(8,10,0)
107- import  GHC.Hs.Extension  (NoExtField (NoExtField ))
108- #elif  MIN_VERSION_ghc(8,6,0)
109- import  GHC.Hs.Extension  (NoExt (NoExt ))
11089#else 
111- import  PlaceHolder  ( PlaceHolder ( .. ))
90+ import  GHC.Hs.Extension  ( NoExtField ( NoExtField ))
11291#endif 
11392
11493import  GHC.SourceGen.Binds.Internal 
@@ -191,14 +170,8 @@ class' context name vars decls
191170            , tcdCExt =  (EpAnnNotUsed , NoAnnSortKey )
192171#elif  MIN_VERSION_ghc(9,2,0)
193172            , tcdCExt =  (EpAnnNotUsed , NoAnnSortKey , NoLayoutInfo )
194- #elif  MIN_VERSION_ghc(9,0,0)
195-             , tcdCExt =  NoLayoutInfo 
196- #elif  MIN_VERSION_ghc(8,10,0)
197-             , tcdCExt =  NoExtField 
198- #elif  MIN_VERSION_ghc(8,6,0)
199-             , tcdCExt =  NoExt 
200173#else 
201-             , tcdFVs  =  PlaceHolder 
174+             , tcdCExt  =  NoLayoutInfo 
202175#endif 
203176            , tcdLName =  typeRdrName $  unqual name
204177            , tcdTyVars =  mkQTyVars vars
@@ -261,10 +234,8 @@ instance' ty decls = noExt InstD  $ noExt ClsInstD $ ClsInstDecl
261234    , cid_ext =  (Nothing , [] , NoAnnSortKey )
262235#elif  MIN_VERSION_ghc(9,2,0)
263236    , cid_ext =  (EpAnnNotUsed , NoAnnSortKey )
264- #elif   MIN_VERSION_ghc(8,10,0) 
237+ #else  
265238    , cid_ext =  NoExtField 
266- #elif  MIN_VERSION_ghc(8,6,0)
267-     , cid_ext =  NoExt 
268239#endif 
269240    , cid_binds =  listToBag [mkLocated b |  InstBind  b <-  decls]
270241    , cid_sigs =  [mkLocated sig |  InstSig  sig <-  decls]
@@ -317,19 +288,6 @@ tyFamInst name params ty = tyFamInstD
317288    tyFamInstDecl =  withEpAnnNotUsed TyFamInstDecl 
318289    famEqn tycon bndrs pats =  withEpAnnNotUsed FamEqn  tycon bndrs (map  HsValArg  pats)
319290    eqn_bndrs =  noExt HsOuterImplicit 
320- #elif  MIN_VERSION_ghc(8,8,0)
321- tyFamInst name params ty =  tyFamInstD
322-         $  tyFamInstDecl
323-         $  famEqn
324-             (typeRdrName name)
325-             eqn_bndrs
326-             (map  mkLocated params)
327-             Prefix 
328-             (mkLocated ty)
329-   where 
330-     tyFamInstDecl =  TyFamInstDecl  .  withPlaceHolder .  noExt (withPlaceHolder HsIB )
331-     famEqn tycon bndrs pats =  noExt FamEqn  tycon bndrs (map  HsValArg   pats)
332-     eqn_bndrs =  Nothing 
333291#else 
334292tyFamInst name params ty =  tyFamInstD
335293        $  tyFamInstDecl
@@ -341,7 +299,7 @@ tyFamInst name params ty = tyFamInstD
341299            (mkLocated ty)
342300  where 
343301    tyFamInstDecl =  TyFamInstDecl  .  withPlaceHolder .  noExt (withPlaceHolder HsIB )
344-     famEqn tycon _  =  noExt FamEqn  tycon
302+     famEqn tycon bndrs pats  =  noExt FamEqn  tycon bndrs ( map   HsValArg   pats) 
345303    eqn_bndrs =  Nothing 
346304#endif 
347305
@@ -541,11 +499,6 @@ strict f = f { strictness = SrcStrict }
541499lazy  ::  Field  ->  Field 
542500lazy f =  f { strictness =  SrcLazy  }
543501
544- #if  !MIN_VERSION_ghc(9,0,0)
545- hsUnrestricted  ::  a  ->  a 
546- hsUnrestricted =  id 
547- #endif 
548- 
549502renderField  ::  Field  ->  LHsType  GhcPs 
550503--  TODO: parenthesizeTypeForApp is an overestimate in the case of
551504--  rendering an infix or record type.
@@ -567,10 +520,8 @@ renderCon98Decl name details =
567520    conDeclH98 =  ConDeclH98  [] 
568521#elif  MIN_VERSION_ghc(9,2,0)
569522    conDeclH98 =  withEpAnnNotUsed ConDeclH98 
570- #elif  MIN_VERSION_ghc(8,6,0)
571-     conDeclH98 n =  noExt ConDeclH98  n .  builtLoc
572523#else 
573-     conDeclH98 n _ _  =   ConDeclH98  n Nothing 
524+     conDeclH98 n =  noExt  ConDeclH98  n .  builtLoc 
574525#endif 
575526
576527deriving'  ::  [HsType' ] ->  HsDerivingClause' 
@@ -626,7 +577,6 @@ derivingAnyclass = derivingWay (Just strat)
626577    strat =  AnyclassStrategy 
627578#endif 
628579
629- #if  MIN_VERSION_ghc(8,6,0)
630580--  |  A `DerivingVia` clause. 
631581-- 
632582--  > deriving (Eq, Show) via T 
@@ -643,7 +593,6 @@ derivingVia t = derivingWay (Just $ strat $ sigType t)
643593#else 
644594    strat =  ViaStrategy 
645595#endif 
646- #endif 
647596
648597standaloneDeriving  ::  HsType'  ->  HsDecl' 
649598standaloneDeriving =  standaloneDerivingWay Nothing 
@@ -691,12 +640,7 @@ standaloneDerivingWay way ty = noExt DerivD derivDecl
691640#else 
692641          withEpAnnNotUsed DerivDecl  (hsWC $  sigType ty) (fmap  builtLoc way) Nothing 
693642#endif 
694-         hsWC = 
695- #if  MIN_VERSION_ghc(8,6,0)
696-           noExt HsWC 
697- #else 
698-           id 
699- #endif 
643+         hsWC =  noExt HsWC 
700644
701645--  |  Declares multiple pattern signatures of the same type. 
702646-- 
0 commit comments