[Git][ghc/ghc][wip/az/epa-hslet-tokens] EPA: Remove EpAnn from SigD extension points

Alan Zimmerman (@alanz) gitlab at gitlab.haskell.org
Tue Dec 12 18:35:40 UTC 2023



Alan Zimmerman pushed to branch wip/az/epa-hslet-tokens at Glasgow Haskell Compiler / GHC


Commits:
cb2c2387 by Alan Zimmerman at 2023-12-12T18:35:03+00:00
EPA: Remove EpAnn from SigD extension points

- - - - -


13 changed files:

- compiler/GHC/Hs/Binds.hs
- compiler/GHC/Hs/Decls.hs
- compiler/GHC/Parser.y
- compiler/GHC/Parser/PostProcess.hs
- testsuite/tests/haddock/should_compile_flag_haddock/T17544.stderr
- testsuite/tests/haddock/should_compile_flag_haddock/T17544_kw.stderr
- testsuite/tests/parser/should_compile/DumpParsedAst.stderr
- testsuite/tests/parser/should_compile/DumpSemis.stderr
- testsuite/tests/parser/should_compile/KindSigs.stderr
- testsuite/tests/parser/should_compile/T20846.stderr
- testsuite/tests/parser/should_compile/T23315/T23315.stderr
- utils/check-exact/ExactPrint.hs
- utils/check-exact/Transform.hs


Changes:

=====================================
compiler/GHC/Hs/Binds.hs
=====================================
@@ -114,7 +114,7 @@ type instance XFunBind    (GhcPass pL) GhcTc = (HsWrapper, [CoreTickish])
 -- type         Int -> forall a'. a' -> a'
 -- Notice that the coercion captures the free a'.
 
-type instance XPatBind    GhcPs (GhcPass pR) = EpAnn [AddEpAnn]
+type instance XPatBind    GhcPs (GhcPass pR) = [AddEpAnn]
 type instance XPatBind    GhcRn (GhcPass pR) = NameSet -- See Note [Bind free vars]
 type instance XPatBind    GhcTc (GhcPass pR) =
     ( Type                  -- Type of the GRHSs
@@ -671,16 +671,16 @@ instance OutputableBndrId p => Outputable (IPBind (GhcPass p)) where
 ************************************************************************
 -}
 
-type instance XTypeSig          (GhcPass p) = EpAnn AnnSig
-type instance XPatSynSig        (GhcPass p) = EpAnn AnnSig
-type instance XClassOpSig       (GhcPass p) = EpAnn AnnSig
-type instance XFixSig           (GhcPass p) = EpAnn [AddEpAnn]
-type instance XInlineSig        (GhcPass p) = EpAnn [AddEpAnn]
-type instance XSpecSig          (GhcPass p) = EpAnn [AddEpAnn]
-type instance XSpecInstSig      (GhcPass p) = (EpAnn [AddEpAnn], SourceText)
-type instance XMinimalSig       (GhcPass p) = (EpAnn [AddEpAnn], SourceText)
-type instance XSCCFunSig        (GhcPass p) = (EpAnn [AddEpAnn], SourceText)
-type instance XCompleteMatchSig (GhcPass p) = (EpAnn [AddEpAnn], SourceText)
+type instance XTypeSig          (GhcPass p) = AnnSig
+type instance XPatSynSig        (GhcPass p) = AnnSig
+type instance XClassOpSig       (GhcPass p) = AnnSig
+type instance XFixSig           (GhcPass p) = [AddEpAnn]
+type instance XInlineSig        (GhcPass p) = [AddEpAnn]
+type instance XSpecSig          (GhcPass p) = [AddEpAnn]
+type instance XSpecInstSig      (GhcPass p) = ([AddEpAnn], SourceText)
+type instance XMinimalSig       (GhcPass p) = ([AddEpAnn], SourceText)
+type instance XSCCFunSig        (GhcPass p) = ([AddEpAnn], SourceText)
+type instance XCompleteMatchSig (GhcPass p) = ([AddEpAnn], SourceText)
     -- SourceText: Note [Pragma source text] in "GHC.Types.SourceText"
 type instance XXSig             GhcPs = DataConCantHappen
 type instance XXSig             GhcRn = IdSig


=====================================
compiler/GHC/Hs/Decls.hs
=====================================
@@ -656,7 +656,7 @@ instance OutputableBndrId p => Outputable (DerivClauseTys (GhcPass p)) where
   ppr (DctSingle _ ty) = ppr ty
   ppr (DctMulti _ tys) = parens (interpp'SP tys)
 
-type instance XStandaloneKindSig GhcPs = EpAnn [AddEpAnn]
+type instance XStandaloneKindSig GhcPs = [AddEpAnn]
 type instance XStandaloneKindSig GhcRn = NoExtField
 type instance XStandaloneKindSig GhcTc = NoExtField
 
@@ -1003,13 +1003,13 @@ type instance XCDerivDecl    GhcPs = ( Maybe (LWarningTxt GhcPs)
                                            -- The warning of the deprecated derivation
                                            -- See Note [Implementation of deprecated instances]
                                            -- in GHC.Tc.Solver.Dict
-                                     , EpAnn [AddEpAnn] )
+                                     , [AddEpAnn] )
 type instance XCDerivDecl    GhcRn = ( Maybe (LWarningTxt GhcRn)
                                            -- The warning of the deprecated derivation
                                            -- See Note [Implementation of deprecated instances]
                                            -- in GHC.Tc.Solver.Dict
-                                     , EpAnn [AddEpAnn] )
-type instance XCDerivDecl    GhcTc = EpAnn [AddEpAnn]
+                                     , [AddEpAnn] )
+type instance XCDerivDecl    GhcTc = [AddEpAnn]
 type instance XXDerivDecl    (GhcPass _) = DataConCantHappen
 
 derivDeprecation :: forall p. IsPass p
@@ -1190,13 +1190,13 @@ instance OutputableBndrId p
 ************************************************************************
 -}
 
-type instance XCRuleDecls    GhcPs = (EpAnn [AddEpAnn], SourceText)
+type instance XCRuleDecls    GhcPs = ([AddEpAnn], SourceText)
 type instance XCRuleDecls    GhcRn = SourceText
 type instance XCRuleDecls    GhcTc = SourceText
 
 type instance XXRuleDecls    (GhcPass _) = DataConCantHappen
 
-type instance XHsRule       GhcPs = (EpAnn HsRuleAnn, SourceText)
+type instance XHsRule       GhcPs = (HsRuleAnn, SourceText)
 type instance XHsRule       GhcRn = (HsRuleRn, SourceText)
 type instance XHsRule       GhcTc = (HsRuleRn, SourceText)
 


=====================================
compiler/GHC/Parser.y
=====================================
@@ -1259,7 +1259,7 @@ topdecl :: { LHsDecl GhcPs }
         | 'foreign' fdecl                       {% acsA (\cs -> sLL $1 $> ((snd $ unLoc $2) (EpAnn (glEE $1 $>) (mj AnnForeign $1:(fst $ unLoc $2)) cs))) }
         | '{-# DEPRECATED' deprecations '#-}'   {% amsA' (sLL $1 $> $ WarningD noExtField (Warnings ([mo $1,mc $3], (getDEPRECATED_PRAGs $1)) (fromOL $2))) }
         | '{-# WARNING' warnings '#-}'          {% amsA' (sLL $1 $> $ WarningD noExtField (Warnings ([mo $1,mc $3], (getWARNING_PRAGs $1)) (fromOL $2))) }
-        | '{-# RULES' rules '#-}'               {% acsA (\cs -> sLL $1 $> $ RuleD noExtField (HsRules ((EpAnn (glEE $1 $>) [mo $1,mc $3] cs), (getRULES_PRAGs $1)) (reverse $2))) }
+        | '{-# RULES' rules '#-}'               {% amsA' (sLL $1 $> $ RuleD noExtField (HsRules ([mo $1,mc $3], (getRULES_PRAGs $1)) (reverse $2))) }
         | annotation { $1 }
         | decl_no_th                            { $1 }
 
@@ -1626,8 +1626,8 @@ stand_alone_deriving :: { LDerivDecl GhcPs }
   : 'deriving' deriv_standalone_strategy 'instance' maybe_warning_pragma overlap_pragma inst_type
                 {% do { let { err = text "in the stand-alone deriving instance"
                                     <> colon <+> quotes (ppr $6) }
-                      ; acsA (\cs -> sLL $1 $>
-                                 (DerivDecl ($4, EpAnn (glEE $1 $>) [mj AnnDeriving $1, mj AnnInstance $3] cs) (mkHsWildCardBndrs $6) $2 $5)) }}
+                      ; amsA' (sLL $1 $>
+                                 (DerivDecl ($4, [mj AnnDeriving $1, mj AnnInstance $3]) (mkHsWildCardBndrs $6) $2 $5)) }}
 
 -----------------------------------------------------------------------------
 -- Role annotations
@@ -1696,8 +1696,8 @@ where_decls :: { LocatedL (OrdList (LHsDecl GhcPs)) }
 
 pattern_synonym_sig :: { LSig GhcPs }
         : 'pattern' con_list '::' sigtype
-                   {% acsA (\cs -> sLL $1 $>
-                                $ PatSynSig (EpAnn (glEE $1 $>) (AnnSig (mu AnnDcolon $3) [mj AnnPattern $1]) cs)
+                   {% amsA' (sLL $1 $>
+                                $ PatSynSig (AnnSig (mu AnnDcolon $3) [mj AnnPattern $1])
                                   (toList $ unLoc $2) $4) }
 
 qvarcon :: { LocatedN RdrName }
@@ -1719,7 +1719,7 @@ decl_cls  : at_decl_cls                 { $1 }
                        do { v <- checkValSigLhs $2
                           ; let err = text "in default signature" <> colon <+>
                                       quotes (ppr $2)
-                          ; acsA (\cs -> sLL $1 $> $ SigD noExtField $ ClassOpSig (EpAnn (glEE $1 $>) (AnnSig (mu AnnDcolon $3) [mj AnnDefault $1]) cs) True [v] $4) }}
+                          ; amsA' (sLL $1 $> $ SigD noExtField $ ClassOpSig (AnnSig (mu AnnDcolon $3) [mj AnnDefault $1]) True [v] $4) }}
 
 decls_cls :: { Located ([AddEpAnn],OrdList (LHsDecl GhcPs)) }  -- Reversed
           : decls_cls ';' decl_cls      {% if isNilOL (snd $ unLoc $1)
@@ -1879,12 +1879,12 @@ rule    :: { LRuleDecl GhcPs }
         : STRING rule_activation rule_foralls infixexp '=' exp
          {%runPV (unECP $4) >>= \ $4 ->
            runPV (unECP $6) >>= \ $6 ->
-           acsA (\cs -> (sLL $1 $> $ HsRule
-                                   { rd_ext = (EpAnn (glEE $1 $>) ((fstOf3 $3) (mj AnnEqual $5 : (fst $2))) cs, getSTRINGs $1)
+           amsA' (sLL $1 $> $ HsRule
+                                   { rd_ext = (((fstOf3 $3) (mj AnnEqual $5 : (fst $2))), getSTRINGs $1)
                                    , rd_name = L (noAnnSrcSpan $ gl $1) (getSTRING $1)
                                    , rd_act = (snd $2) `orElse` AlwaysActive
                                    , rd_tyvs = sndOf3 $3, rd_tmvs = thdOf3 $3
-                                   , rd_lhs = $4, rd_rhs = $6 })) }
+                                   , rd_lhs = $4, rd_rhs = $6 }) }
 
 -- Rules can be specified to be NeverActive, unlike inline/specialize pragmas
 rule_activation :: { ([AddEpAnn],Maybe Activation) }
@@ -2609,14 +2609,14 @@ sigdecl :: { LHsDecl GhcPs }
           infixexp     '::' sigtype
                         {% do { $1 <- runPV (unECP $1)
                               ; v <- checkValSigLhs $1
-                              ; acsA (\cs -> (sLL $1 $> $ SigD noExtField $
-                                  TypeSig (EpAnn (glEE $1 $>) (AnnSig (mu AnnDcolon $2) []) cs) [v] (mkHsWildCardBndrs $3)))} }
+                              ; amsA' (sLL $1 $> $ SigD noExtField $
+                                  TypeSig (AnnSig (mu AnnDcolon $2) []) [v] (mkHsWildCardBndrs $3))} }
 
         | var ',' sig_vars '::' sigtype
            {% do { v <- addTrailingCommaN $1 (gl $2)
-                 ; let sig cs = TypeSig (EpAnn (glR $1) (AnnSig (mu AnnDcolon $4) []) cs) (v : reverse (unLoc $3))
+                 ; let sig = TypeSig (AnnSig (mu AnnDcolon $4) []) (v : reverse (unLoc $3))
                                       (mkHsWildCardBndrs $5)
-                 ; acsA (\cs -> sLL $1 $> $ SigD noExtField (sig cs) ) }}
+                 ; amsA' (sLL $1 $> $ SigD noExtField sig ) }}
 
         | infix prec ops
              {% do { mbPrecAnn <- traverse (\l2 -> do { checkPrecP l2 $3
@@ -2627,8 +2627,8 @@ sigdecl :: { LHsDecl GhcPs }
                                                 -- it defaults to maxPrecedence
                                                 Nothing -> (NoSourceText, maxPrecedence)
                                                 Just l2 -> (fst $ unLoc l2, snd $ unLoc l2)
-                   ; acsA (\cs -> sLL $1 $> $ SigD noExtField
-                            (FixSig (EpAnn (glEE $1 $>) (mj AnnInfix $1 : maybeToList mbPrecAnn) cs) (FixitySig noExtField (fromOL $ unLoc $3)
+                   ; amsA' (sLL $1 $> $ SigD noExtField
+                            (FixSig (mj AnnInfix $1 : maybeToList mbPrecAnn) (FixitySig noExtField (fromOL $ unLoc $3)
                                     (Fixity fixText fixPrec (unLoc $1)))))
                    }}
 
@@ -2636,44 +2636,42 @@ sigdecl :: { LHsDecl GhcPs }
 
         | '{-# COMPLETE' qcon_list opt_tyconsig  '#-}'
                 {% let (dcolon, tc) = $3
-                   in acsA
-                       (\cs -> sLL $1 $>
-                         (SigD noExtField (CompleteMatchSig ((EpAnn (glEE $1 $>) ([ mo $1 ] ++ dcolon ++ [mc $4]) cs), (getCOMPLETE_PRAGs $1)) $2 tc))) }
+                   in amsA' (sLL $1 $>
+                         (SigD noExtField (CompleteMatchSig ([ mo $1 ] ++ dcolon ++ [mc $4], (getCOMPLETE_PRAGs $1)) $2 tc))) }
 
         -- This rule is for both INLINE and INLINABLE pragmas
         | '{-# INLINE' activation qvarcon '#-}'
-                {% acsA (\cs -> (sLL $1 $> $ SigD noExtField (InlineSig (EpAnn (glEE $1 $>) ((mo $1:fst $2) ++ [mc $4]) cs) $3
+                {% amsA' (sLL $1 $> $ SigD noExtField (InlineSig ((mo $1:fst $2) ++ [mc $4]) $3
                             (mkInlinePragma (getINLINE_PRAGs $1) (getINLINE $1)
-                                            (snd $2))))) }
+                                            (snd $2)))) }
         | '{-# OPAQUE' qvar '#-}'
-                {% acsA (\cs -> (sLL $1 $> $ SigD noExtField (InlineSig (EpAnn (glEE $1 $>) [mo $1, mc $3] cs) $2
-                            (mkOpaquePragma (getOPAQUE_PRAGs $1))))) }
+                {% amsA' (sLL $1 $> $ SigD noExtField (InlineSig [mo $1, mc $3] $2
+                            (mkOpaquePragma (getOPAQUE_PRAGs $1)))) }
         | '{-# SCC' qvar '#-}'
-          {% acsA (\cs -> sLL $1 $> (SigD noExtField (SCCFunSig ((EpAnn (glEE $1 $>) [mo $1, mc $3] cs), (getSCC_PRAGs $1)) $2 Nothing))) }
+          {% amsA' (sLL $1 $> (SigD noExtField (SCCFunSig ([mo $1, mc $3], (getSCC_PRAGs $1)) $2 Nothing))) }
 
         | '{-# SCC' qvar STRING '#-}'
           {% do { scc <- getSCC $3
                 ; let str_lit = StringLiteral (getSTRINGs $3) scc Nothing
-                ; acsA (\cs -> sLL $1 $> (SigD noExtField (SCCFunSig ((EpAnn (glEE $1 $>) [mo $1, mc $4] cs), (getSCC_PRAGs $1)) $2 (Just ( sL1a $3 str_lit))))) }}
+                ; amsA' (sLL $1 $> (SigD noExtField (SCCFunSig ([mo $1, mc $4], (getSCC_PRAGs $1)) $2 (Just ( sL1a $3 str_lit))))) }}
 
         | '{-# SPECIALISE' activation qvar '::' sigtypes1 '#-}'
-             {% acsA (\cs ->
+             {% amsA' (
                  let inl_prag = mkInlinePragma (getSPEC_PRAGs $1)
                                              (NoUserInlinePrag, FunLike) (snd $2)
-                  in sLL $1 $> $ SigD noExtField (SpecSig (EpAnn (glEE $1 $>) (mo $1:mu AnnDcolon $4:mc $6:(fst $2)) cs) $3 (fromOL $5) inl_prag)) }
+                  in sLL $1 $> $ SigD noExtField (SpecSig (mo $1:mu AnnDcolon $4:mc $6:(fst $2)) $3 (fromOL $5) inl_prag)) }
 
         | '{-# SPECIALISE_INLINE' activation qvar '::' sigtypes1 '#-}'
-             {% acsA (\cs -> sLL $1 $> $ SigD noExtField (SpecSig (EpAnn (glEE $1 $>) (mo $1:mu AnnDcolon $4:mc $6:(fst $2)) cs) $3 (fromOL $5)
+             {% amsA' (sLL $1 $> $ SigD noExtField (SpecSig (mo $1:mu AnnDcolon $4:mc $6:(fst $2)) $3 (fromOL $5)
                                (mkInlinePragma (getSPEC_INLINE_PRAGs $1)
                                                (getSPEC_INLINE $1) (snd $2)))) }
 
         | '{-# SPECIALISE' 'instance' inst_type '#-}'
-                {% acsA (\cs -> sLL $1 $>
-                                  $ SigD noExtField (SpecInstSig ((EpAnn (glEE $1 $>) [mo $1,mj AnnInstance $2,mc $4] cs), (getSPEC_PRAGs $1)) $3)) }
+                {% amsA' (sLL $1 $> $ SigD noExtField (SpecInstSig ([mo $1,mj AnnInstance $2,mc $4], (getSPEC_PRAGs $1)) $3)) }
 
         -- A minimal complete definition
         | '{-# MINIMAL' name_boolformula_opt '#-}'
-            {% acsA (\cs -> sLL $1 $> $ SigD noExtField (MinimalSig ((EpAnn (glEE $1 $>) [mo $1,mc $3] cs), (getMINIMAL_PRAGs $1)) $2)) }
+            {% amsA' (sLL $1 $> $ SigD noExtField (MinimalSig ([mo $1,mc $3], (getMINIMAL_PRAGs $1)) $2)) }
 
 activation :: { ([AddEpAnn],Maybe Activation) }
         -- See Note [%shift: activation -> {- empty -}]


=====================================
compiler/GHC/Parser/PostProcess.hs
=====================================
@@ -276,9 +276,8 @@ mkStandaloneKindSig
 mkStandaloneKindSig loc lhs rhs anns =
   do { vs <- mapM check_lhs_name (unLoc lhs)
      ; v <- check_singular_lhs (reverse vs)
-     ; cs <- getCommentsFor loc
      ; return $ L (noAnnSrcSpan loc)
-       $ StandaloneKindSig (EpAnn (spanAsAnchor loc) anns cs) v rhs }
+       $ StandaloneKindSig anns v rhs }
   where
     check_lhs_name v@(unLoc->name) =
       if isUnqual name && isTcOcc (rdrNameOcc name)
@@ -1366,9 +1365,8 @@ checkPatBind loc annsIn (L _ (BangPat (EpAnn _ ans cs) (L _ (VarPat _ v))))
                   , m_pats = []
                  , m_grhss = grhss }
 
-checkPatBind loc annsIn lhs (L _ grhss) = do
-  cs <- getCommentsFor loc
-  return (PatBind (EpAnn (spanAsAnchor loc) annsIn cs) lhs grhss)
+checkPatBind _loc annsIn lhs (L _ grhss) = do
+  return (PatBind annsIn lhs grhss)
 
 checkValSigLhs :: LHsExpr GhcPs -> P (LocatedN RdrName)
 checkValSigLhs (L _ (HsVar _ lrdr@(L _ v)))


=====================================
testsuite/tests/haddock/should_compile_flag_haddock/T17544.stderr
=====================================
@@ -91,13 +91,9 @@
          (EpaComments
           []))
         (ClassOpSig
-         (EpAnn
-          (EpaSpan { T17544.hs:6:3-16 })
-          (AnnSig
-           (AddEpAnn AnnDcolon (EpaSpan { T17544.hs:6:6-7 }))
-           [])
-          (EpaComments
-           []))
+         (AnnSig
+          (AddEpAnn AnnDcolon (EpaSpan { T17544.hs:6:6-7 }))
+          [])
          (False)
          [(L
            (EpAnn
@@ -254,13 +250,9 @@
          (EpaComments
           []))
         (ClassOpSig
-         (EpAnn
-          (EpaSpan { T17544.hs:10:3-16 })
-          (AnnSig
-           (AddEpAnn AnnDcolon (EpaSpan { T17544.hs:10:6-7 }))
-           [])
-          (EpaComments
-           []))
+         (AnnSig
+          (AddEpAnn AnnDcolon (EpaSpan { T17544.hs:10:6-7 }))
+          [])
          (False)
          [(L
            (EpAnn
@@ -415,13 +407,9 @@
          (EpaComments
           []))
         (ClassOpSig
-         (EpAnn
-          (EpaSpan { T17544.hs:14:3-16 })
-          (AnnSig
-           (AddEpAnn AnnDcolon (EpaSpan { T17544.hs:14:6-7 }))
-           [])
-          (EpaComments
-           []))
+         (AnnSig
+          (AddEpAnn AnnDcolon (EpaSpan { T17544.hs:14:6-7 }))
+          [])
          (False)
          [(L
            (EpAnn
@@ -579,13 +567,9 @@
          (EpaComments
           []))
         (ClassOpSig
-         (EpAnn
-          (EpaSpan { T17544.hs:18:3-16 })
-          (AnnSig
-           (AddEpAnn AnnDcolon (EpaSpan { T17544.hs:18:6-7 }))
-           [])
-          (EpaComments
-           []))
+         (AnnSig
+          (AddEpAnn AnnDcolon (EpaSpan { T17544.hs:18:6-7 }))
+          [])
          (False)
          [(L
            (EpAnn
@@ -666,13 +650,9 @@
          (EpaComments
           []))
         (ClassOpSig
-         (EpAnn
-          (EpaSpan { T17544.hs:20:3-16 })
-          (AnnSig
-           (AddEpAnn AnnDcolon (EpaSpan { T17544.hs:20:6-7 }))
-           [])
-          (EpaComments
-           []))
+         (AnnSig
+          (AddEpAnn AnnDcolon (EpaSpan { T17544.hs:20:6-7 }))
+          [])
          (False)
          [(L
            (EpAnn


=====================================
testsuite/tests/haddock/should_compile_flag_haddock/T17544_kw.stderr
=====================================
@@ -332,13 +332,9 @@
          (EpaComments
           []))
         (ClassOpSig
-         (EpAnn
-          (EpaSpan { T17544_kw.hs:24:5-18 })
-          (AnnSig
-           (AddEpAnn AnnDcolon (EpaSpan { T17544_kw.hs:24:15-16 }))
-           [])
-          (EpaComments
-           []))
+         (AnnSig
+          (AddEpAnn AnnDcolon (EpaSpan { T17544_kw.hs:24:15-16 }))
+          [])
          (False)
          [(L
            (EpAnn


=====================================
testsuite/tests/parser/should_compile/DumpParsedAst.stderr
=====================================
@@ -193,12 +193,8 @@
     (KindSigD
      (NoExtField)
      (StandaloneKindSig
-      (EpAnn
-       (EpaSpan { DumpParsedAst.hs:9:1-27 })
-       [(AddEpAnn AnnType (EpaSpan { DumpParsedAst.hs:9:1-4 }))
-       ,(AddEpAnn AnnDcolon (EpaSpan { DumpParsedAst.hs:9:13-14 }))]
-       (EpaComments
-        []))
+      [(AddEpAnn AnnType (EpaSpan { DumpParsedAst.hs:9:1-4 }))
+      ,(AddEpAnn AnnDcolon (EpaSpan { DumpParsedAst.hs:9:13-14 }))]
       (L
        (EpAnn
         (EpaSpan { DumpParsedAst.hs:9:6-11 })
@@ -827,12 +823,8 @@
     (KindSigD
      (NoExtField)
      (StandaloneKindSig
-      (EpAnn
-       (EpaSpan { DumpParsedAst.hs:17:1-35 })
-       [(AddEpAnn AnnType (EpaSpan { DumpParsedAst.hs:17:1-4 }))
-       ,(AddEpAnn AnnDcolon (EpaSpan { DumpParsedAst.hs:17:9-10 }))]
-       (EpaComments
-        []))
+      [(AddEpAnn AnnType (EpaSpan { DumpParsedAst.hs:17:1-4 }))
+      ,(AddEpAnn AnnDcolon (EpaSpan { DumpParsedAst.hs:17:9-10 }))]
       (L
        (EpAnn
         (EpaSpan { DumpParsedAst.hs:17:6-7 })


=====================================
testsuite/tests/parser/should_compile/DumpSemis.stderr
=====================================
@@ -151,13 +151,9 @@
     (SigD
      (NoExtField)
      (TypeSig
-      (EpAnn
-       (EpaSpan { DumpSemis.hs:9:1-12 })
-       (AnnSig
-        (AddEpAnn AnnDcolon (EpaSpan { DumpSemis.hs:9:5-6 }))
-        [])
-       (EpaComments
-        []))
+      (AnnSig
+       (AddEpAnn AnnDcolon (EpaSpan { DumpSemis.hs:9:5-6 }))
+       [])
       [(L
         (EpAnn
          (EpaSpan { DumpSemis.hs:9:1-3 })
@@ -448,13 +444,9 @@
     (SigD
      (NoExtField)
      (TypeSig
-      (EpAnn
-       (EpaSpan { DumpSemis.hs:14:1-12 })
-       (AnnSig
-        (AddEpAnn AnnDcolon (EpaSpan { DumpSemis.hs:14:5-6 }))
-        [])
-       (EpaComments
-        []))
+      (AnnSig
+       (AddEpAnn AnnDcolon (EpaSpan { DumpSemis.hs:14:5-6 }))
+       [])
       [(L
         (EpAnn
          (EpaSpan { DumpSemis.hs:14:1-3 })
@@ -708,13 +700,9 @@
     (SigD
      (NoExtField)
      (TypeSig
-      (EpAnn
-       (EpaSpan { DumpSemis.hs:21:1-12 })
-       (AnnSig
-        (AddEpAnn AnnDcolon (EpaSpan { DumpSemis.hs:21:5-6 }))
-        [])
-       (EpaComments
-        []))
+      (AnnSig
+       (AddEpAnn AnnDcolon (EpaSpan { DumpSemis.hs:21:5-6 }))
+       [])
       [(L
         (EpAnn
          (EpaSpan { DumpSemis.hs:21:1-3 })
@@ -1359,13 +1347,9 @@
          (EpaComments
           []))
         (ClassOpSig
-         (EpAnn
-          (EpaSpan { DumpSemis.hs:29:3-23 })
-          (AnnSig
-           (AddEpAnn AnnDcolon (EpaSpan { DumpSemis.hs:29:9-10 }))
-           [])
-          (EpaComments
-           []))
+         (AnnSig
+          (AddEpAnn AnnDcolon (EpaSpan { DumpSemis.hs:29:9-10 }))
+          [])
          (False)
          [(L
            (EpAnn
@@ -1453,13 +1437,9 @@
     (SigD
      (NoExtField)
      (TypeSig
-      (EpAnn
-       (EpaSpan { DumpSemis.hs:31:1-30 })
-       (AnnSig
-        (AddEpAnn AnnDcolon (EpaSpan { DumpSemis.hs:31:3-4 }))
-        [])
-       (EpaComments
-        []))
+      (AnnSig
+       (AddEpAnn AnnDcolon (EpaSpan { DumpSemis.hs:31:3-4 }))
+       [])
       [(L
         (EpAnn
          (EpaSpan { DumpSemis.hs:31:1 })


=====================================
testsuite/tests/parser/should_compile/KindSigs.stderr
=====================================
@@ -714,13 +714,9 @@
     (SigD
      (NoExtField)
      (TypeSig
-      (EpAnn
-       (EpaSpan { KindSigs.hs:22:1-44 })
-       (AnnSig
-        (AddEpAnn AnnDcolon (EpaSpan { KindSigs.hs:22:5-6 }))
-        [])
-       (EpaComments
-        []))
+      (AnnSig
+       (AddEpAnn AnnDcolon (EpaSpan { KindSigs.hs:22:5-6 }))
+       [])
       [(L
         (EpAnn
          (EpaSpan { KindSigs.hs:22:1-3 })
@@ -1480,13 +1476,9 @@
     (SigD
      (NoExtField)
      (TypeSig
-      (EpAnn
-       (EpaSpan { KindSigs.hs:34:1-22 })
-       (AnnSig
-        (AddEpAnn AnnDcolon (EpaSpan { KindSigs.hs:34:6-7 }))
-        [])
-       (EpaComments
-        []))
+      (AnnSig
+       (AddEpAnn AnnDcolon (EpaSpan { KindSigs.hs:34:6-7 }))
+       [])
       [(L
         (EpAnn
          (EpaSpan { KindSigs.hs:34:1-4 })


=====================================
testsuite/tests/parser/should_compile/T20846.stderr
=====================================
@@ -43,11 +43,7 @@
     (SigD
      (NoExtField)
      (FixSig
-      (EpAnn
-       (EpaSpan { T20846.hs:3:1-11 })
-       [(AddEpAnn AnnInfix (EpaSpan { T20846.hs:3:1-6 }))]
-       (EpaComments
-        []))
+      [(AddEpAnn AnnInfix (EpaSpan { T20846.hs:3:1-6 }))]
       (FixitySig
        (NoExtField)
        [(L


=====================================
testsuite/tests/parser/should_compile/T23315/T23315.stderr
=====================================
@@ -61,13 +61,9 @@
     (SigD
      (NoExtField)
      (TypeSig
-      (EpAnn
-       (EpaSpan { T23315.hsig:3:1-7 })
-       (AnnSig
-        (AddEpAnn AnnDcolon (EpaSpan { T23315.hsig:3:3-4 }))
-        [])
-       (EpaComments
-        []))
+      (AnnSig
+       (AddEpAnn AnnDcolon (EpaSpan { T23315.hsig:3:3-4 }))
+       [])
       [(L
         (EpAnn
          (EpaSpan { T23315.hsig:3:1 })


=====================================
utils/check-exact/ExactPrint.hs
=====================================
@@ -776,6 +776,11 @@ markLensAA (EpAnn anc a cs) l = do
   a' <- markKw (view l a)
   return (EpAnn anc (set l a' a) cs)
 
+markLensAA' :: (Monad m, Monoid w) => a -> Lens a AddEpAnn -> EP w m a
+markLensAA' a l = do
+  a' <- markKw (view l a)
+  return (set l a' a)
+
 
 markEpAnnLMS :: (Monad m, Monoid w)
   => EpAnn a -> Lens a [AddEpAnn] -> AnnKeywordId -> Maybe String -> EP w m (EpAnn a)
@@ -900,13 +905,9 @@ markAnnOpenP' :: (Monad m, Monoid w) => AnnPragma -> SourceText -> String -> EP
 markAnnOpenP' an NoSourceText txt   = markEpAnnLMS0 an lapr_open AnnOpen (Just txt)
 markAnnOpenP' an (SourceText txt) _ = markEpAnnLMS0 an lapr_open AnnOpen (Just $ unpackFS txt)
 
-markAnnOpen :: (Monad m, Monoid w) => EpAnn [AddEpAnn] -> SourceText -> String -> EP w m (EpAnn [AddEpAnn])
-markAnnOpen an NoSourceText txt   = markEpAnnLMS an lidl AnnOpen (Just txt)
-markAnnOpen an (SourceText txt) _ = markEpAnnLMS an lidl AnnOpen (Just $ unpackFS txt)
-
-markAnnOpen0 :: (Monad m, Monoid w) => [AddEpAnn] -> SourceText -> String -> EP w m [AddEpAnn]
-markAnnOpen0 an NoSourceText txt   = markEpAnnLMS'' an lidl AnnOpen (Just txt)
-markAnnOpen0 an (SourceText txt) _ = markEpAnnLMS'' an lidl AnnOpen (Just $ unpackFS txt)
+markAnnOpen :: (Monad m, Monoid w) => [AddEpAnn] -> SourceText -> String -> EP w m [AddEpAnn]
+markAnnOpen an NoSourceText txt   = markEpAnnLMS'' an lidl AnnOpen (Just txt)
+markAnnOpen an (SourceText txt) _ = markEpAnnLMS'' an lidl AnnOpen (Just $ unpackFS txt)
 
 markAnnOpen' :: (Monad m, Monoid w)
   => Maybe EpaLocation -> SourceText -> String -> EP w m (Maybe EpaLocation)
@@ -1987,13 +1988,13 @@ rendering the DataDefn are contained in the FamEqn, and are called
 -- ---------------------------------------------------------------------
 
 instance ExactPrint (DerivDecl GhcPs) where
-  getAnnotationEntry (DerivDecl {deriv_ext = (_, an)} ) = fromAnn an
-  setAnnotationAnchor (dd at DerivDecl {deriv_ext = (w, an)}) anc ts cs
-    = dd { deriv_ext = (w, setAnchorEpa an anc ts cs) }
+  getAnnotationEntry _ = NoEntryVal
+  setAnnotationAnchor a _ _ _ = a
+
   exact (DerivDecl (mw, an) typ ms mov) = do
-    an0 <- markEpAnnL an lidl AnnDeriving
+    an0 <- markEpAnnL' an lidl AnnDeriving
     ms' <- mapM markAnnotated ms
-    an1 <- markEpAnnL an0 lidl AnnInstance
+    an1 <- markEpAnnL' an0 lidl AnnInstance
     mw' <- mapM markAnnotated mw
     mov' <- mapM markAnnotated mov
     typ' <- markAnnotated typ
@@ -2081,7 +2082,7 @@ instance ExactPrint (WarnDecls GhcPs) where
   setAnnotationAnchor a _ _ _ = a
 
   exact (Warnings (an,src) warns) = do
-    an0 <- markAnnOpen0 an src "{-# WARNING" -- Note: might be {-# DEPRECATED
+    an0 <- markAnnOpen an src "{-# WARNING" -- Note: might be {-# DEPRECATED
     warns' <- markAnnotated warns
     an1 <- markEpAnnLMS'' an0 lidl AnnClose (Just "#-}")
     return (Warnings (an1,src) warns')
@@ -2131,66 +2132,63 @@ instance ExactPrint FastString where
 -- ---------------------------------------------------------------------
 
 instance ExactPrint (RuleDecls GhcPs) where
-  getAnnotationEntry (HsRules (an,_) _) = fromAnn an
-  setAnnotationAnchor (HsRules (an,a) b) anc ts cs = HsRules ((setAnchorEpa an anc ts cs),a) b
+  getAnnotationEntry _ = NoEntryVal
+  setAnnotationAnchor a _ _ _ = a
   exact (HsRules (an, src) rules) = do
     an0 <-
       case src of
-        NoSourceText      -> markEpAnnLMS an lidl AnnOpen  (Just "{-# RULES")
-        SourceText srcTxt -> markEpAnnLMS an lidl AnnOpen  (Just $ unpackFS srcTxt)
+        NoSourceText      -> markEpAnnLMS'' an lidl AnnOpen  (Just "{-# RULES")
+        SourceText srcTxt -> markEpAnnLMS'' an lidl AnnOpen  (Just $ unpackFS srcTxt)
     rules' <- markAnnotated rules
-    an1 <- markEpAnnLMS an0 lidl AnnClose (Just "#-}")
+    an1 <- markEpAnnLMS'' an0 lidl AnnClose (Just "#-}")
     return (HsRules (an1,src) rules')
 
 -- ---------------------------------------------------------------------
 
 instance ExactPrint (RuleDecl GhcPs) where
-  getAnnotationEntry (HsRule {rd_ext = (an,_)}) = fromAnn an
-  setAnnotationAnchor r@(HsRule {rd_ext = (an,a)}) anc ts cs
-    = r { rd_ext = (setAnchorEpa an anc ts cs, a)}
+  getAnnotationEntry _ = NoEntryVal
+  setAnnotationAnchor a _ _ _ = a
+
   exact (HsRule (an,nsrc) (L ln n) act mtybndrs termbndrs lhs rhs) = do
-    debugM "HsRule entered"
     (L ln' _) <- markAnnotated (L ln (nsrc, n))
-    debugM "HsRule after ln"
     an0 <- markActivation an lra_rest act
-    debugM "HsRule after act"
     (an1, mtybndrs') <-
       case mtybndrs of
         Nothing -> return (an0, Nothing)
         Just bndrs -> do
-          an1 <-  markLensMAA an0 lra_tyanns_fst  -- AnnForall
+          an1 <-  markLensMAA' an0 lra_tyanns_fst  -- AnnForall
           bndrs' <- mapM markAnnotated bndrs
-          an2 <- markLensMAA an1 lra_tyanns_snd  -- AnnDot
+          an2 <- markLensMAA' an1 lra_tyanns_snd  -- AnnDot
           return (an2, Just bndrs')
 
-    an2 <- markLensMAA an1 lra_tmanns_fst  -- AnnForall
+    an2 <- markLensMAA' an1 lra_tmanns_fst  -- AnnForall
     termbndrs' <- mapM markAnnotated termbndrs
-    an3 <- markLensMAA an2 lra_tmanns_snd  -- AnnDot
+    an3 <- markLensMAA' an2 lra_tmanns_snd  -- AnnDot
 
     lhs' <- markAnnotated lhs
-    an4 <- markEpAnnL an3 lra_rest AnnEqual
+    an4 <- markEpAnnL' an3 lra_rest AnnEqual
     rhs' <- markAnnotated rhs
     return (HsRule (an4,nsrc) (L ln' n) act mtybndrs' termbndrs' lhs' rhs')
 
 markActivation :: (Monad m, Monoid w)
-  => EpAnn a -> Lens a [AddEpAnn] -> Activation -> EP w m (EpAnn a)
+  => a -> Lens a [AddEpAnn] -> Activation -> EP w m a
 markActivation an l act = do
   case act of
     ActiveBefore src phase -> do
-      an0 <- markEpAnnL an l AnnOpenS --  '['
-      an1 <- markEpAnnL an0 l AnnTilde -- ~
-      an2 <- markEpAnnLMS an1 l AnnVal (Just (toSourceTextWithSuffix src (show phase) ""))
-      an3 <- markEpAnnL an2 l AnnCloseS -- ']'
+      an0 <- markEpAnnL' an l AnnOpenS --  '['
+      an1 <- markEpAnnL' an0 l AnnTilde -- ~
+      an2 <- markEpAnnLMS'' an1 l AnnVal (Just (toSourceTextWithSuffix src (show phase) ""))
+      an3 <- markEpAnnL' an2 l AnnCloseS -- ']'
       return an3
     ActiveAfter src phase -> do
-      an0 <- markEpAnnL an l AnnOpenS --  '['
-      an1 <- markEpAnnLMS an0 l AnnVal (Just (toSourceTextWithSuffix src (show phase) ""))
-      an2 <- markEpAnnL an1 l AnnCloseS -- ']'
+      an0 <- markEpAnnL' an l AnnOpenS --  '['
+      an1 <- markEpAnnLMS'' an0 l AnnVal (Just (toSourceTextWithSuffix src (show phase) ""))
+      an2 <- markEpAnnL' an1 l AnnCloseS -- ']'
       return an2
     NeverActive -> do
-      an0 <- markEpAnnL an l AnnOpenS --  '['
-      an1 <- markEpAnnL an0 l AnnTilde -- ~
-      an2 <- markEpAnnL an1 l AnnCloseS -- ']'
+      an0 <- markEpAnnL' an l AnnOpenS --  '['
+      an1 <- markEpAnnL' an0 l AnnTilde -- ~
+      an2 <- markEpAnnL' an1 l AnnCloseS -- ']'
       return an2
     _ -> return an
 
@@ -2429,12 +2427,7 @@ instance ExactPrint (LocatedP OverlapMode) where
 -- ---------------------------------------------------------------------
 
 instance ExactPrint (HsBind GhcPs) where
-  getAnnotationEntry FunBind{} = NoEntryVal
-  getAnnotationEntry PatBind{pat_ext=an} = fromAnn an
-  getAnnotationEntry VarBind{} = NoEntryVal
-  getAnnotationEntry PatSynBind{} = NoEntryVal
-
-  setAnnotationAnchor pb at PatBind{} anc ts cs = pb { pat_ext = setAnchorEpa (pat_ext pb) anc ts cs}
+  getAnnotationEntry _ = NoEntryVal
   setAnnotationAnchor a _ _ _ = a
 
   exact (FunBind x fid matches) = do
@@ -2734,42 +2727,23 @@ orderByFst (a,_) (b,_) = compare a b
 -- ---------------------------------------------------------------------
 
 instance ExactPrint (Sig GhcPs) where
-  getAnnotationEntry (TypeSig a _ _)  = fromAnn a
-  getAnnotationEntry (PatSynSig a _ _) = fromAnn a
-  getAnnotationEntry (ClassOpSig a _ _ _) = fromAnn a
-  getAnnotationEntry (FixSig a _) = fromAnn a
-  getAnnotationEntry (InlineSig a _ _) = fromAnn a
-  getAnnotationEntry (SpecSig a _ _ _) = fromAnn a
-  getAnnotationEntry (SpecInstSig (a, _) _) = fromAnn a
-  getAnnotationEntry (MinimalSig (a, _) _) = fromAnn a
-  getAnnotationEntry (SCCFunSig (a, _) _ _) = fromAnn a
-  getAnnotationEntry (CompleteMatchSig (a, _) _ _) = fromAnn a
-
-  setAnnotationAnchor (TypeSig a x y)  anc           ts cs = (TypeSig (setAnchorEpa a anc ts cs) x y)
-  setAnnotationAnchor (PatSynSig a x y) anc          ts cs = (PatSynSig (setAnchorEpa a anc ts cs) x y)
-  setAnnotationAnchor (ClassOpSig a x y z) anc       ts cs = (ClassOpSig (setAnchorEpa a anc ts cs) x y z)
-  setAnnotationAnchor (FixSig a x) anc               ts cs = (FixSig (setAnchorEpa a anc ts cs) x)
-  setAnnotationAnchor (InlineSig a x y) anc          ts cs = (InlineSig (setAnchorEpa a anc ts cs) x y)
-  setAnnotationAnchor (SpecSig a x y z) anc          ts cs = (SpecSig (setAnchorEpa a anc ts cs) x y z)
-  setAnnotationAnchor (SpecInstSig (a,x) y) anc      ts cs = (SpecInstSig ((setAnchorEpa a anc ts cs),x) y)
-  setAnnotationAnchor (MinimalSig (a,x) y) anc       ts cs = (MinimalSig ((setAnchorEpa a anc ts cs),x) y)
-  setAnnotationAnchor (SCCFunSig (a,x) y z) anc      ts cs = (SCCFunSig ((setAnchorEpa a anc ts cs),x) y z)
-  setAnnotationAnchor (CompleteMatchSig (a,x) y z) anc ts cs = (CompleteMatchSig ((setAnchorEpa a anc ts cs),x) y z)
+  getAnnotationEntry _ = NoEntryVal
+  setAnnotationAnchor a _ _ _ = a
 
   exact (TypeSig an vars ty)  = do
     (an', vars', ty') <- exactVarSig an vars ty
     return (TypeSig an' vars' ty')
 
   exact (PatSynSig an lns typ) = do
-    an0 <- markEpAnnL an lasRest AnnPattern
+    an0 <- markEpAnnL' an lasRest AnnPattern
     lns' <- markAnnotated lns
-    an1 <- markLensAA an0 lasDcolon
+    an1 <- markLensAA' an0 lasDcolon
     typ' <- markAnnotated typ
     return (PatSynSig an1 lns' typ')
 
   exact (ClassOpSig an is_deflt vars ty)
     | is_deflt  = do
-        an0 <- markEpAnnL an lasRest AnnDefault
+        an0 <- markEpAnnL' an lasRest AnnDefault
         (an1, vars',ty') <- exactVarSig an0 vars ty
         return (ClassOpSig an1 is_deflt vars' ty')
     | otherwise = do
@@ -2781,8 +2755,8 @@ instance ExactPrint (Sig GhcPs) where
          InfixL -> "infixl"
          InfixR -> "infixr"
          InfixN -> "infix"
-    an0 <- markEpAnnLMS an  lidl AnnInfix (Just fixstr)
-    an1 <- markEpAnnLMS an0 lidl AnnVal (Just (sourceTextToString src (show v)))
+    an0 <- markEpAnnLMS'' an  lidl AnnInfix (Just fixstr)
+    an1 <- markEpAnnLMS'' an0 lidl AnnVal (Just (sourceTextToString src (show v)))
     names' <- markAnnotated names
     return (FixSig an1 (FixitySig x names' (Fixity src v fdir)))
 
@@ -2790,40 +2764,36 @@ instance ExactPrint (Sig GhcPs) where
     an0 <- markAnnOpen an (inl_src inl) "{-# INLINE"
     an1 <- markActivation an0 id (inl_act inl)
     ln' <- markAnnotated ln
-    debugM $ "InlineSig:an=" ++ showAst an
-    p <- getPosP
-    debugM $ "InlineSig: p=" ++ show p
-    an2 <- markEpAnnLMS an1 lidl AnnClose (Just "#-}")
-    debugM $ "InlineSig:done"
+    an2 <- markEpAnnLMS'' an1 lidl AnnClose (Just "#-}")
     return (InlineSig an2 ln' inl)
 
   exact (SpecSig an ln typs inl) = do
     an0 <- markAnnOpen an (inl_src inl) "{-# SPECIALISE" -- Note: may be {-# SPECIALISE_INLINE
     an1 <- markActivation an0 lidl (inl_act inl)
     ln' <- markAnnotated ln
-    an2 <- markEpAnnL an1 lidl AnnDcolon
+    an2 <- markEpAnnL' an1 lidl AnnDcolon
     typs' <- markAnnotated typs
-    an3 <- markEpAnnLMS an2 lidl AnnClose (Just "#-}")
+    an3 <- markEpAnnLMS'' an2 lidl AnnClose (Just "#-}")
     return (SpecSig an3 ln' typs' inl)
 
   exact (SpecInstSig (an,src) typ) = do
     an0 <- markAnnOpen an src "{-# SPECIALISE"
-    an1 <- markEpAnnL an0 lidl AnnInstance
+    an1 <- markEpAnnL' an0 lidl AnnInstance
     typ' <- markAnnotated typ
-    an2 <- markEpAnnLMS an1 lidl AnnClose (Just "#-}")
+    an2 <- markEpAnnLMS'' an1 lidl AnnClose (Just "#-}")
     return (SpecInstSig (an2,src) typ')
 
   exact (MinimalSig (an,src) formula) = do
     an0 <- markAnnOpen an src "{-# MINIMAL"
     formula' <- markAnnotated formula
-    an1 <- markEpAnnLMS an0 lidl AnnClose (Just "#-}")
+    an1 <- markEpAnnLMS'' an0 lidl AnnClose (Just "#-}")
     return (MinimalSig (an1,src) formula')
 
   exact (SCCFunSig (an,src) ln ml) = do
     an0 <- markAnnOpen an src "{-# SCC"
     ln' <- markAnnotated ln
     ml' <- markAnnotated ml
-    an1 <- markEpAnnLMS an0 lidl AnnClose (Just "#-}")
+    an1 <- markEpAnnLMS'' an0 lidl AnnClose (Just "#-}")
     return (SCCFunSig (an1,src) ln' ml')
 
   exact (CompleteMatchSig (an,src) cs mty) = do
@@ -2833,32 +2803,32 @@ instance ExactPrint (Sig GhcPs) where
       case mty of
         Nothing -> return (an0, mty)
         Just ty -> do
-          an1 <- markEpAnnL an0 lidl AnnDcolon
+          an1 <- markEpAnnL' an0 lidl AnnDcolon
           ty' <- markAnnotated ty
           return (an1, Just ty')
-    an2 <- markEpAnnLMS an1 lidl AnnClose (Just "#-}")
+    an2 <- markEpAnnLMS'' an1 lidl AnnClose (Just "#-}")
     return (CompleteMatchSig (an2,src) cs' mty')
 
 -- ---------------------------------------------------------------------
 
 exactVarSig :: (Monad m, Monoid w, ExactPrint a)
-  => EpAnn AnnSig -> [LocatedN RdrName] -> a -> EP w m (EpAnn AnnSig, [LocatedN RdrName], a)
+  => AnnSig -> [LocatedN RdrName] -> a -> EP w m (AnnSig, [LocatedN RdrName], a)
 exactVarSig an vars ty = do
   vars' <- mapM markAnnotated vars
-  an0 <- markLensAA an lasDcolon
+  an0 <- markLensAA' an lasDcolon
   ty' <- markAnnotated ty
   return (an0, vars', ty')
 
 -- ---------------------------------------------------------------------
 
 instance ExactPrint (StandaloneKindSig GhcPs) where
-  getAnnotationEntry (StandaloneKindSig an _ _) = fromAnn an
-  setAnnotationAnchor (StandaloneKindSig an a b) anc ts cs = StandaloneKindSig (setAnchorEpa an anc ts cs) a b
+  getAnnotationEntry _ = NoEntryVal
+  setAnnotationAnchor a _ _ _ = a
 
   exact (StandaloneKindSig an vars sig) = do
-    an0 <- markEpAnnL an lidl AnnType
+    an0 <- markEpAnnL' an lidl AnnType
     vars' <- markAnnotated vars
-    an1 <- markEpAnnL an0 lidl AnnDcolon
+    an1 <- markEpAnnL' an0 lidl AnnDcolon
     sig' <- markAnnotated sig
     return (StandaloneKindSig an1 vars' sig')
 


=====================================
utils/check-exact/Transform.hs
=====================================
@@ -210,8 +210,8 @@ captureLineSpacing ds = map (\(_,_,x) -> x) $ go (map to ds)
 -- ---------------------------------------------------------------------
 
 captureTypeSigSpacing :: LHsDecl GhcPs -> LHsDecl GhcPs
-captureTypeSigSpacing (L l (SigD x (TypeSig (EpAnn anc (AnnSig dc rs') cs) ns (HsWC xw ty))))
-  = (L l (SigD x (TypeSig (EpAnn anc (AnnSig dc' rs') cs) ns (HsWC xw ty'))))
+captureTypeSigSpacing (L l (SigD x (TypeSig (AnnSig dc rs') ns (HsWC xw ty))))
+  = (L l (SigD x (TypeSig (AnnSig dc' rs') ns (HsWC xw ty'))))
   where
     -- we want DPs for the distance from the end of the ns to the
     -- AnnDColon, and to the start of the ty



View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/commit/cb2c2387f04b95df859f31721ca0173b6c1db1b0

-- 
View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/commit/cb2c2387f04b95df859f31721ca0173b6c1db1b0
You're receiving this email because of your account on gitlab.haskell.org.


-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.haskell.org/pipermail/ghc-commits/attachments/20231212/cd00973e/attachment-0001.html>


More information about the ghc-commits mailing list